android 两个按钮,先按button1再加button2 然后跳转另一个页面

android 两个按钮,先按button1再加button2 然后跳转另一个页面

Intent intent = new Intent(IntentDemo.this, AnotherActivity2.class);
startActivity(intent);

实现跳转。

button1按一下不执行,button2里面写如上代码。

http://www.cnblogs.com/hummersofdie/archive/2011/02/12/1952675.html

你可以这样啊 先把button2的Enable设为false,点击button1时设置button2的Enable设为true,在button2写上你要跳转的页面

最好的办法就是用变量实现,上楼的都说得很明白了,用变量记录,

弄两个 intent 不就行了么

跳转之前加一个判断 如果button1 button2都被点击才实现该方法

你是说要两个button 同时处于按下的状态时,跳转activity吗?
这种情况,不太好实现,android系统,同一个时间只响应一个View的 ontouchListener,
你可以自定义一个view,然后用手势原理去实现