如何在android模拟器中运行特定活动? [英] how to run Specific activity in android emulator?

查看:134
本文介绍了如何在android模拟器中运行特定活动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在eclipse中创建了4个活动,现在我想分别在模拟器中逐个运行活动1、2、3、4进行测试.

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.

将提供任何帮助.

推荐答案

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

这篇关于如何在android模拟器中运行特定活动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆