如何实现启动一个程序的activity 小弟新手,今天读了google的gesture的DEMO,就是想画个手势启动个想启动的程序,怎么实现啊? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 创建一个GestureDetector对象(在创建的时候就可以加入GestureDetector.OnGestureListener监听器),在监听器中实现你需要所需的具体工作 建议看看 1.android.view.GestureDetector、 2.android.view.GestureDetector.OnGestureListener 3.android.content.Intent这几个类,应该会满足你的需求。 你要开什么程序 是一个activity还是别人写好的application 别人写好的APP啊,比如我点一个BUTTON实现打开QQ客户端 new Intent(FromActivity.this, ToActivity.class);你可以看看android.content.Intent 我怎么知道QQ客户端的activity? 你在调试状态下打开qq客户端,查看Log信息有个Displayed后面跟的就是这个值 ComponentName component = new ComponentName("包名", "包名+类名"); Intent intent = new Intent(); intent.setComponent(component); intent.setAction("android.intent.action.MAIN"); intent.addCategory("android.intent.category.LAUNCHER"); startActivity(intent);再使用这种方法打开 确实正确啊,大哥告诉我应该怎么查到这个答案啊?在API么? 关于android AsyncTask 上传图片的问题 Why myPid() and myTid() return the same value? 【请问】移动开发的话使用Ubuntu好还是…… 怎么让自己编的程序在模拟器上能联网…… 地图开发遇到的怪异问题???? Android如何退出整个程序~? 跪求android开源浏览器,支持websocket 为什么拖动view,画面没有刷新? sendTextMessage无法运行 setting中switchpreference问题 多屏幕选择中的滑屏效果是怎么实现的? ANDROID里到底怎么用M3G(JSR184)啊?
3.android.content.Intent
这几个类,应该会满足你的需求。
你可以看看android.content.Intent
你在调试状态下打开qq客户端,查看Log信息有个Displayed后面跟的就是这个值
ComponentName component =
new ComponentName("包名",
"包名+类名");
Intent intent = new Intent();
intent.setComponent(component);
intent.setAction("android.intent.action.MAIN");
intent.addCategory("android.intent.category.LAUNCHER");
startActivity(intent);再使用这种方法打开