2011.07.08(4)——— android Intent.createChooser 应用选择器
2011.07.08(4)——— android Intent.createChooser 应用选择器
参考:http://www.iteye.com/topic/690376
http://www.cnblogs.com/wservices/archive/2010/07/07/1772737.html
http://hi.baidu.com/lck0502/blog/item/2d0036efb844a800fcfa3c58.html
也许 下面的场景 我们经常碰到:
但是 你可知道原因 :
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);intent.setType("audio/*");startActivity(Intent.createChooser(intent, "Select music"));
<activity android:name=".TestActivity" android:label="TestActivity"> <intent-filter><action android:name="android.intent.action.GET_CONTENT" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.OPENABLE" /> <data android:mimeType="audio/music1" /> </intent-filter> </activity>
private void startWallpaper() { closeAllApps(true); final Intent pickWallpaper = new Intent(Intent.ACTION_SET_WALLPAPER); Intent chooser = Intent.createChooser(pickWallpaper, getText(R.string.chooser_wallpaper)); startActivityForResult(chooser, REQUEST_PICK_WALLPAPER); }