내 액티비티에서 비트 맵을 반환하고 싶기 때문에 다른 애플리케이션에서도 사용할 수 있습니다.액티비티로 돌아 가기
텍스트를 반환하는 것은 분명합니다.
Intent data = new Intent();
data.putExtra("text1", "text.");
data.putExtra("text2", "longer text.");
setResult(RESULT_OK, data);
어떻게 비트 맵을 반환하나요?
자세한 정보 : 이미지에는 모든 이미지를 얻으려는 사람이 사용할 수있는 몇 가지 의도가 있습니다.
<intent-filter>
<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.OPENABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
<data android:mimeType="vnd.android.cursor.dir/image" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.PICK" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
<data android:mimeType="vnd.android.cursor.dir/image" />
</intent-filter>
편집 :
public void finish(Bitmap bitmap) {
try {
File folder = new File(Environment.getExternalStorageDirectory() + "/Icon Select/");
if(!folder.exists()) {
folder.mkdirs();
}
File nomediaFile = new File(folder, ".nomedia");
if(!nomediaFile.exists()) {
nomediaFile.createNewFile();
}
FileOutputStream out = new FileOutputStream(Environment.getExternalStorageDirectory() + "/Icon Select/latest.png");
bitmap.compress(Bitmap.CompressFormat.PNG, 90, out);
File bitmapFile = new File(Environment.getExternalStorageDirectory() + "/Icon Select/latest.png");
if(bitmapFile.exists()) {
Intent localIntent = new Intent().setData(Uri.fromFile(bitmapFile));
setResult(RESULT_OK, localIntent);
} else {
setResult(RESULT_CANCELED);
}
super.finish();
} catch (Exception e) {
e.printStackTrace();
Log.d("beewhale", "Error writing data");
}
}
달성하려는 목표는 무엇입니까? 그것을 설명하십시오 –