Call one action from another

How can I trigger another action from one (current) activity? I want to invoke an operation that contains a dialog box from my current activity.

0
android
Mar 01 '11 at 6:18
source share
3 answers

Just post your message in the kit and pass it on to the intention. In the following function, the onCreate function retrieves the package and displays.

Bundle b = new Bundle(); b.putString("message","your message"); Intent i = new Intent(this,NextActivity.class); i.putExtras(b); startActivity(i); 

In the following onCreate operation:

 String message = (String) getIntent().getSerializableExtra("message"); 

show the message ...

+8
Mar 01 '11 at 7:40
source share
 Intent i = new Intent(this, AnotherActivity.class); startActivity(i); 
+7
Mar 01 '11 at 6:21
source share
 Intent i=new Intent(yourpresentactivity.this, nextactivity.class); startActivity(i); 
0
Mar 07 '12 at 6:23
source share



All Articles