简体   繁体   中英

How to navigate to another page in android?

I'm new to android. Please tell me how to navigate to a new page in android. Thanks in advance.

Edit:How to start a new activity from an existing activity

In android to navigate to another page means you have to start another activity. for starting a new activity use this

Intent intent = new Intent(currentActivity.this, nextActivity.class);
startActivity(intent);

You should mention the next activity in the AndroidManifest file.

To change your page (i think you're refering to "Activities" in android you need to issue a so called "intent").

You cann do that by:

startActivity(new Intent(nextactivity,NextActivity.class));

or

startActivityForResult(new Intent(nextactivity,NextActivity.class),1);

if you want the new Activity to return any result to the activity who started the new one.

But what i recommend is, that you read this documentation here:

http://developer.android.com/guide/topics/intents/intents-filters.html

and come back to this question if you have need additional assistance on concrete problems on that topics.

i hope that helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM