UMAR UMAR - 4 months ago 15
Android Question

how to run Specific activity in android emulator?

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.

Answer
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);
}
Comments