查看官方文档,发现这样可以通过packageName获取应用入口的方法:
public abstract Intent getLaunchIntentForPackage (String packageName)
英文原文:Return a “good” intent to launch a front-door activity in a package, for use for example to implement an “open” button when browsing through packages.
返回一个程序入口的Intent,直接startActivity(返回的intent)即可。代码:
PackageManager pm = context.getPackageManager();
Intent intent=pm.getLaunchIntentForPackage(Config.WLANDIALER_PKG_NAME);
intent.setAction(Intent.ACTION_VIEW);
context.startActivity(intent);