Android Question Launching a different launcher

joneden

Active Member
Licensed User
Longtime User
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.

B4X:
    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
 

joneden

Active Member
Licensed User
Longtime User
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
Top