简体   繁体   中英

What are permissions required to call(launch) other apps like whatsapp in my case from our app

My code:

Button buton = (Button) findViewById(R.id.button);

buton.setOnClickListener(new View.OnClickListener() {


public void onClick(View arg0) {

   Intent inte = getPackageManager().getLaunchIntentForPackage("com.whatsapp");
   if (inte != null)
      startActivity(inte);
   else
      toast.show();

You need to verify if the activity of another app that you are willing to run is exported or not. The launcher activity of whatsapp is surely exported so you probably don't need any permission.

You do not need any permission, you can just launch it through an intent. Pay attention, in some cases this might lead to app being refused from the Store (If you invoke another app - like whatsapp - since it might not be fully permitted by whatsapp)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM