最近单位要求APP关注微信公众号功能,但是目前测试只能下载微信,不能实现关注功能,只能退而求次,让客户跳转微信手动关注。
以下为代码:
Intent intentweixn = new Intent();
ComponentName cmp = new ComponentName("com.tencent.mm","com.tencent.mm.ui.LauncherUI");
intentweixn.setAction(Intent.ACTION_MAIN);
intentweixn.addCategory(Intent.CATEGORY_LAUNCHER);
intentweixn.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intentweixn.setComponent(cmp);
startActivityForResult(intentweixn, 0);
下面为几个常用其它APP的包名:
另:几个常用的Package命令:
新浪微博(编辑界面):com.sina.weibo com.sina.weibo.EditActivity
腾讯微博(编辑界面):com.tencent.WBlog com.tencent.WBlog.activity.MicroblogInput
微信: com.tencent.mm com.tencent.mm.ui.LauncherUI
QQ: com.tencent.mobileqq com.tencent.mobileqq.activity.HomeActivity