Android Question Default launcher chooser

jazzzzzzz

Active Member
Licensed User
Longtime User
Maybe we are talking about different things. Are you call StartActivity with an intent?

If so then you should do something like:
B4X:
Dim in As Intent
...
in.WrapAsIntentChooser("Title")
StartActivity(in)

Actually I dont know how to convert the code in that stackoverflow link.

any way I figure an easy fix by the code below and it works flawlessly.
B4X:
public void choose() {
     import android.content.Intent;
    String HOME_CHOOSER_PACKAGE_NAME = "android";
    String HOME_CHOOSER_CLASS_NAME = "com.android.internal.app.ResolverActivity";
   
    Intent i = new Intent(Intent.ACTION_MAIN);
    i.addCategory(Intent.CATEGORY_HOME);
    i.setClassName(HOME_CHOOSER_PACKAGE_NAME, HOME_CHOOSER_CLASS_NAME);
    startActivity(i);
}
 
Upvote 0
Top