J joneden Active Member Licensed User Longtime User Mar 20, 2014 #1 Hi All, I'm have an app that runs as a launcher with a kiosk mode. Occasionally though I need to exit and load the original launcher (in this case it's the Trebuchet launcher). I use the code below and every time the intent is not initialized. Code: Copy Dim objPackageManager As PackageManager Dim objIntent As Intent objIntent = objPackageManager.GetApplicationIntent ("com.cyanogenmod.trebuchet") StartActivity(objIntent) If I change trebuchet to filemanager that works fine to start the filemanager app. So obviously something is different for launchers. Any suggestions? Regards Jon
Hi All, I'm have an app that runs as a launcher with a kiosk mode. Occasionally though I need to exit and load the original launcher (in this case it's the Trebuchet launcher). I use the code below and every time the intent is not initialized. Code: Copy Dim objPackageManager As PackageManager Dim objIntent As Intent objIntent = objPackageManager.GetApplicationIntent ("com.cyanogenmod.trebuchet") StartActivity(objIntent) If I change trebuchet to filemanager that works fine to start the filemanager app. So obviously something is different for launchers. Any suggestions? Regards Jon
Erel B4X founder Staff member Licensed User Longtime User Mar 20, 2014 #2 This code lists all the applications that can be "home" applications: Code: Copy Dim pm As PackageManager Dim i As Intent i.Initialize(i.ACTION_MAIN, "") i.AddCategory("android.intent.category.HOME") Log(pm.QueryIntentActivities(i)) Upvote 0
This code lists all the applications that can be "home" applications: Code: Copy Dim pm As PackageManager Dim i As Intent i.Initialize(i.ACTION_MAIN, "") i.AddCategory("android.intent.category.HOME") Log(pm.QueryIntentActivities(i))
J joneden Active Member Licensed User Longtime User Mar 20, 2014 #3 Thanks Erel, That lists the trebuchet launcher and my own launcher as expected however I still have the issue whereby I get an object not initialized error on the StartActivity line: java.lang.RuntimeException: Object should first be initialized (Intent). Is there an alternate way of launching an app? Regards Jon Upvote 0
Thanks Erel, That lists the trebuchet launcher and my own launcher as expected however I still have the issue whereby I get an object not initialized error on the StartActivity line: java.lang.RuntimeException: Object should first be initialized (Intent). Is there an alternate way of launching an app? Regards Jon
Erel B4X founder Staff member Licensed User Longtime User Mar 20, 2014 #4 Don't use GetApplicationIntent. You should instead get the required information from QueryIntentActivities: http://www.b4x.com/search?query=PackageManager.QueryIntentActivities Upvote 0
Don't use GetApplicationIntent. You should instead get the required information from QueryIntentActivities: http://www.b4x.com/search?query=PackageManager.QueryIntentActivities
J joneden Active Member Licensed User Longtime User Mar 20, 2014 #5 Thanks Erel, I'm using that and it works - many thanks. Upvote 0