Android 意图:未显示默认应用程序选项
我的目的是让用户在Android设备上选择现有的图像。使用以下代码或类似代码,createChooser意图确实显示了选择设备上图像的多个选项(ASTRO、Gallery等),但没有显示“默认情况下用于此操作”复选框Android 意图:未显示默认应用程序选项,android,Android,我的目的是让用户在Android设备上选择现有的图像。使用以下代码或类似代码,createChooser意图确实显示了选择设备上图像的多个选项(ASTRO、Gallery等),但没有显示“默认情况下用于此操作”复选框 Intent intent = new Intent(); intent.setType("image/jpg"); intent.setAction(Intent.ACTION_GET_CONTENT); startActivityForResult( Inten
Intent intent = new Intent();
intent.setType("image/jpg");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(
Intent.createChooser(intent, "Select Picture"),
PICK_IMAGE);
我一定是忽略了什么。我根据2.1、2.2和4.0.3编译了应用程序,但没有用。已在我的Nexus S、Galaxy S和emulator上试用。如果使用
createChooser()
,则不会出现“默认使用此操作”复选框。如果您想要该复选框,请去掉createChooser()
,只需将intent
传递到startActivityForResult()
谢谢您提供的宝贵信息!