views:

284

answers:

3

dear friends,

i have created 4 activities in eclipse now i want to run activity 1, 2,3 ,4 repectively one by one in emulator for testing.

can any one guide me how can i run those all???

when i press run button it only runs first activity.

any help would be appriciated.

A: 
public void onClick(View v) {

    Intent i;

    i = new Intent(this, YourActivity1.class);
    startActivity(i);

    i = new Intent(this, YourActivity2.class);
    startActivity(i);

    i = new Intent(this, YourActivity3.class);
    startActivity(i);

    i = new Intent(this, YourActivity4.class);
    startActivity(i);
}
fupsduck
A: 
You could try startActivityForResult but you may need to possibly modify your program your applications to handle this.
I would suggest using one of the android sdk tools called am (activity manager).
In the adb shell:
# am start -n package-name/activity-1-name
# am start -n package-name/activity-2-name
# am start -n package-name/activity-3-name
# am start -n package-name/activity-4-name
ddcruver
A: 
ddcruver