Buttons under the android Tab

Source: Internet
Author: User

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Reply:

 

  • Shi Fei replied that he should not obtain this button in ontabchanged () at. In oncreate (), he should first find the button with findviewbyid, and then write setonclicklistener (New button. onclicklistener (){

    Public void onclick (view v) {} function is helpful(0)| No help(0)| Comment(0)| Reference this answer
  • I did not know if you want to report the Report on. I used ontabchanged () to switch to display the tab subpage, and then click a button on the tab subpage. If so, you should obtain this button in the oncreate () method on the tab subpage and set the click event.--- There are 3 comments in total ---

    • @: As you said, the result is as if you didn't get this button. The system. Out. println () Printing Test is useless. The program does not seem to have listened to the click event of this button (6 months ago by Chen Yixin)

       
    • @ Chen Yixin: Obtain the button in the oncreate () method of the 'tab1' activity (6 months ago, by the lost D scholar)
    • As you said. However, whether it is getting this button in the oncreate () method or ontabchanged () method, the system does not respond after the button is clicked, and no error message is reported. (6 months ago by Chen Yixin)
    Helpful(0)| No help(0)| Comment(3)| Reference this answer
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.