如何使用Android Intent.createChooser()?
我正在尝试使用选择器,因此不必创建选择器对话框。可能是使用了错误的构造或小部件。所发生的事情是,我提供的意图列表被插入到选择器对话框中,但我设备上的所有其他应用程序也是如此。然后,如果我使用后退按钮,应用程序“完成” 调用是:如何使用Android Intent.createChooser()?,android,dialog,selection,Android,Dialog,Selection,我正在尝试使用选择器,因此不必创建选择器对话框。可能是使用了错误的构造或小部件。所发生的事情是,我提供的意图列表被插入到选择器对话框中,但我设备上的所有其他应用程序也是如此。然后,如果我使用后退按钮,应用程序“完成” 调用是: Intent intentChooser = Intent.createChooser(intentDocumentView, "Choose A Chapter"); Parcelable [] parcelable = new Parcelable [2]; pa
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 LabeledIntent(intentDoc1, "com.mobibob.myapp", "Title 1", 0);
intentChooser.putExtra(Intent.EXTRA_INITIAL_INTENTS, parcelable);
int whichDocument = RESULT_FIRST_USER;
startActivityForResult(intentChooser, whichDocument);
我是否需要在intentChooser中指定更多内容??类别旗帜?额外服务?已经有一段时间了,但我遇到了类似的问题,谷歌让我转到你的帖子。只是想补充一点,我可以在这里找到一个解决方案->。祝你好运