开发者

How to pass intents to open another activity with button? [closed]

开发者 https://www.devze.com 2023-04-01 16:49 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Cl开发者_JAVA技巧osed 11 years ago.

How to pass the intent to open another activity with button?


You have to create an onclicklistener on the button write something like:

button.setOnclickListener(new View.OnClickListener() 
{
    Intent myIntent = new Intent(CurrentActivity.this, NextActivity.class);
    CurrentActivity.this.startActivity(myIntent);
}

Create new activity in manifest.

Have a look at this tutorial http://www.warriorpoint.com/blog/2009/05/24/android-how-to-switch-between-activities/

0

精彩评论

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