Using a viewpager in Mainactivity (aa, bb, cc).You are showing xml.
If the button declared in aa.xml
public void onCreate(Bundle savedInstanceState)
{ super.onCreate(savedInstanceState);
setContentView(R.layout.aa);
} I tried to refer to the class that declared that it was dead, so I looked for a way
at Mainactivity.class private View.OnClickListener mPagerListener = new View.OnClickListener() { @Override public void onClick(View v) { What to do when you click a button } };
This way, the button gets a click event.
If you have any questions (aaa, bb, cc) layout buttons, text views, etc. included in the view phaser If you want to operate the event, you can only declare it in the Mainactivity.class The code becomes too messy.
Do you know how to use the general method, i.e. declare a .class for each layout? Is there a way to operate?
android
Look for an example of displaying fragments instead of .xml in the viewpager.
http://itpangpang.xyz/286 I think this example might be a little helpful, so I'm going to upload it.
© 2024 OneMinuteCode. All rights reserved.