开发者

How to use the Android Intent.createChooser()?

I am trying to use the chooser so I don't have to create a selector-dialog. Maybe it is the wrong construct or widget to be using. What is happening is that the list of intents that I supply are inserted into a chooser dialog, but so are all the other applications on my device. Then if I use the back-button, the application "finishes."

The invocation is:

Intent intentChooser = Intent.createChooser(intentDocumentView, "Choose A Chapter");

Parcelable [] parcelable = new Parcelable [2]; 
parcelable[0] = new LabeledIntent(intentDoc0, "com.mobibob.myapp", "Title 0", 0);
parcelable[1] = new Labe开发者_运维技巧ledIntent(intentDoc1, "com.mobibob.myapp", "Title 1", 0);
intentChooser.putExtra(Intent.EXTRA_INITIAL_INTENTS, parcelable);
int whichDocument = RESULT_FIRST_USER;
startActivityForResult(intentChooser, whichDocument);

Do I need to specify more in the intentChooser?? category? flags? extras?


It's been a while, but I've had a similar issue and google let me to your post. Just wanted to add that I was able to find a solution using suggestion on here -> twitter integration on android app. Good luck!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜