调用方法如下:
Intent intent = new Intent(Intent.ACTION_ATTACH_DATA); intent.addCategory(Intent.CATEGORY_DEFAULT); intent.setDataAndType(Uri.fromFile(new File("/sdcard/test.jpg")), "image/jpeg"); intent.putExtra("mimeType", "image/jpeg"); this.startActivityForResult( Intent.createChooser(intent, "Set as:"), CAMERA_COMPLETE);
需要的权限:
<uses-permission android:name="android.permission.SET_WALLPAPER" />