Skip to content Skip to sidebar Skip to footer

Call A Method In The Main Activity. From A Custom View Class

i am using the following method in a new application i'm developing. there is a main activity, which instantiates different classes that extends RelativeLayout, and i'm using setCo

Solution 1:

I'd recommend using different activities, then you automatically get navigation between them via the back button. Plus, there will be subtle things that won't work right if you do it the way you're describing -- for example, Android automatically saves the focused control when you switch activities. It won't do this for your content views; you would have to save/restore focus yourself.

Alternatively, if it doesn't make sense for a user to go "back and forth" between the screens of your application, then you could still implement the application with multiple activities, using android.app.TabHost. This is what the Contact app uses, for example. Then each screen is just a sub-activity, and the whole app is really treated as a single activity. And if you want, you can use TabHost without actually having tabs. You can hide the tabs and enable navigation via buttons or menu items instead.

Post a Comment for "Call A Method In The Main Activity. From A Custom View Class"