android中怎么为一个取消按钮加响应 我现在在做一个程序,想个一个“取消”的按钮加响应,当你点击取消的时候会返回主屏幕,请大虾指教~ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Button cancel = (Button)new Button(this); cancel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(); i.setPackage("com.android.launcher"); i.setAction(Intent.ACTION_MAIN); startActivity(i); } }); 实在很感谢,这个实现了我想要的功能,"com.android.launcher"什么意思啊 实在很感谢,这个实现了我想要的功能,"com.android.launcher"什么意思啊 这个是launcher应用的包名 找到launcher程序中action 为intent.ACTION_MAIN 的activity 跳转 不要去指定launcher 要去启动HOME有些手机上没有com.android.launcher 调用就会出错的 请教layout的移动问题 Wireshark 抓包 问题 出现以下错误 android中使用ksoap2调用web servie(asmx)时,HttpTransportSE.call速度为何极慢? android 画图 android 游戏运行时手机来电了怎么处理 [BK_求助]Android:GoogleMap使用的包com.google.android.map无法找到 探讨一下360 手机卫士的实现原理? java程序如何hook? 关于Android截屏服务开发 SimpleAdapter参数问题 在Android用外放播放音乐的时候,插上耳机怎么让声音切到耳机播放?
cancel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent();
i.setPackage("com.android.launcher");
i.setAction(Intent.ACTION_MAIN);
startActivity(i);
}
});
这个是launcher应用的包名 找到launcher程序中action 为intent.ACTION_MAIN 的activity 跳转
有些手机上没有com.android.launcher
调用就会出错的