Reputation: 9
I want a way to set up a MX Player to play videos in my application.
Upvotes: 0
Views: 1538
Reputation: 10235
This will launch any installed version of MX Player(Not tested).You need to add data to the intent to play videos. Good luck with your app.
Intent intent;
PackageManager packageManager=getPackageManager();
try {
intent= packageManager.getLaunchIntentForPackage("com.mxtech.videoplayer.pro");
if (null != intent)this.startActivity(intent);
}
catch (ActivityNotFoundException e) {
//MX Player pro isn't installed
try{
intent= packageManager.getLaunchIntentForPackage("com.mxtech.videoplayer.ad");
if (null != intent)this.startActivity(intent);
}
catch (ActivityNotFoundException e) {
//No version of MX Player is installed.You should let the user know
}
}
Upvotes: 0