Launch Mx Player through intent

后端 未结 2 926
执笔经年
执笔经年 2021-02-06 19:05

here is my code to call mxplayer but it didn\'t work, why ?

Intent myIntent ;
PackageManager manager = getPackageManager();
myIntent = manager.getLaunchIntentFo         


        
2条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-06 19:17

    The developer of MX Player documented its package namespaces here: https://sites.google.com/site/mxvpen/api

    So if you have installed the pro version, you need to use another name.

    [Package]
    com.mxtech.videoplayer.pro  - Pro Edition
    com.mxtech.videoplayer.ad - Free Edition.
    

    Further more you can catch the exception for the case, that the MX Player isn't installed on the system:

    Intent myIntent;
        PackageManager pm = getPackageManager();
        try {
            myIntent = pm.getLaunchIntentForPackage(YourPackageName);
            if (null != myIntent)
                this.startActivity(myIntent);
        } catch (ActivityNotFoundException e) {
    
        }
    

提交回复
热议问题