2013年1月2日 星期三

start application knowing package name


Can someone tell me how to start new application knowing only its package name? I do not have information about what activity is the main one.
share|improve this question

feedback
Try using PackageManager and getLaunchIntentForPackage()
share|improve this answer
Thanks, I missed this function while looking at PackageManager... – bart Aug 6 '10 at 10:33
feedback
Just use these following two lines,so you can launch any installed application whose package name is known:
Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage("com.example.abc");
startActivity
( LaunchIntent );
share|improve this answer

沒有留言:

張貼留言

Related Posts Plugin for WordPress, Blogger...