Skip to content Skip to sidebar Skip to footer

How To Open An External Application From Widget In Android?

When we click the widget at that time i need to open an external aplication (for example netflix app).How to do this? In all cases i find solutions like that but, is not what I'm

Solution 1:

Try this but you should know the package name of that another application

PackageManagerpm= getPackageManager();
  try
  {
   StringpackageName="com.example.package";
   IntentlaunchIntent= pm.getLaunchIntentForPackage(packageName);
   startActivity(launchIntent);
  }
catch (Exception e1)
{
}

EDIT:

To check the package name of the application, open your file explorer and go to directory called android\data\ here you will find package names of all installed apps

Post a Comment for "How To Open An External Application From Widget In Android?"