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 looking.
Thanks!!
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 looking.
Thanks!!
Try this but you should know the package name of that another application
PackageManager pm = getPackageManager();
try
{
String packageName = "com.example.package";
Intent launchIntent = 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
To create your own widget for external apps, you can use this code:
PackageManager pm = getPackageManager();
try
{
String packageName = "com.example.package";
Intent launchIntent = pm.getLaunchIntentForPackage(packageName);
startActivity(launchIntent);
}
catch (Exception e1)
{
}
So if you need the package name you can find it in a web browser, in google play site.
and then, just remplace it in the code: String packageName = "com.netflix.mediaclient";