ComponentName comp = new ComponentName("包名", "Activity"); Intent intent = new Intent(Intent.ACTION_MAIN); intent.addCategory(Intent.CATEGORY_LAUNCHER); intent.setComponent(comp); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);startActivity(intent);
要知道新浪的包名 packgename="com.sina.weibo" classname="com.sina.weibo.MainTabActivity" ComponentName comp = new ComponentName("packgename", "classname"); Intent intent = new Intent(Intent.ACTION_MAIN); intent.addCategory(Intent.CATEGORY_LAUNCHER); intent.setComponent(comp); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);startActivity(intent);
1.如果新浪微波是一个apk,就用楼上的方法。 2.如果只是一个http link. Intent i = new Intent(); Uri uri = Uri.parse("http....."); i.setAction(Intent.ACTION_VIEW); i.setDataAndType(uri, type); startActivity(i); 具体的uri, type的设置,去网上搜索一下吧。 这样做的目的是,如果有多个浏览器,可以让用户自己选择自己想要的浏览器去看微波
"Activity");
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.setComponent(comp);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);startActivity(intent);
packgename="com.sina.weibo" classname="com.sina.weibo.MainTabActivity"
ComponentName comp = new ComponentName("packgename",
"classname");
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.setComponent(comp);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);startActivity(intent);
2.如果只是一个http link.
Intent i = new Intent();
Uri uri = Uri.parse("http.....");
i.setAction(Intent.ACTION_VIEW);
i.setDataAndType(uri, type);
startActivity(i);
具体的uri, type的设置,去网上搜索一下吧。
这样做的目的是,如果有多个浏览器,可以让用户自己选择自己想要的浏览器去看微波