如何在AndroidQQ(全局意图包中实例参数)

public class MainActivity extends AppCompatActivity {@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);// 获取PackageManager实例以查找全局包信息
PackageManager pm = getPackageManager();Button btn_open_weixin = findViewById(R.id.btn_open_weixin);btn_open_weixin.setOnClickListener(v -> {// 获取在包中打开主活动的意图,参数为包名Intent intent = pm.getLaunchIntentForPackage("com.tencent.mm");startActivity(intent);});Button btn_open_qq = findViewById(R.id.btn_open_qq);btn_open_qq.setOnClickListener(v -> {Intent intent = pm.getLaunchIntentForPackage("com.tencent.mobileqq");startActivity(intent);});}}
如何在AndroidQQ(全局意图包中实例参数)
(图片来源网络,侵删)

联系我们

在线咨询:点击这里给我发消息