Reputation: 1950
I come from Windows .Net forms development.
This is a pretty basic/fundamental question.
I'm attempting to build an Android app that will have multiple screens/forms (like most do)
My question is how do you achieve this in Android?
For example, a listview loads with menu items. When the user clicks a menu item, how is the new layout/form loaded?
Do you simply set visibility of your UI controls based on user actions? Or is there a built in mechanism to control the loading of "forms"?
I hope this makes sense. I have some java background and have actually done a small amount of Android development. (But have yet to do an UI type things)
Edit: A better way to phrase this might be: What is the Android equivalent of forms?
Thanks Kevin
Upvotes: 0
Views: 1275
Reputation: 424
Just an addition to what Hesham Saeed has said, use
setContentView(R.layout.layoutId);
inside MyOtherActivity.java. This will load layoutId.xml layout file.
Upvotes: 2
Reputation: 5378
These forms are called Activities, and each activity binded with a layout/view.
You have to use intents,
Intent newActivity = new Intent(getApplicationContext(),MyOtherActivity.class);
startActivity(newActivity);
Upvotes: 1