开发者

How to navigate to another page in android?

开发者 https://www.devze.com 2023-02-15 11:56 出处:网络
I\'m new to android. Please tell me how to navigate to a new page in android. Thanks in advance. 开发者_如何学PythonEdit:How to start a new activity from an existing activityIn android to navigate to

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

开发者_如何学Python

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消