how to run Specific activity in android emulator?

后端 未结 6 1565
無奈伤痛
無奈伤痛 2021-01-29 00:36

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?

6条回答
  •  一个人的身影
    2021-01-29 01:19

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

提交回复
热议问题