0
나는 이것에 머리를 파고있었습니다. 그걸 가졌어. 앱이 다른 앱으로 사진을 보냈습니다. WhatsApp, Gmail 등을 사용해 보았습니다.하지만 이제는 작동하지 않습니다. 그것은 무엇 일 수 있는가? 포장 문제? 키 스토어 문제? 이제 Gmail을 사용하려고하면 첨부 파일이 표시되지만 이름이 빈 사진처럼 보입니다. 즉, 스마트 폰에서 파일을 찾지 못했다는 의미입니다. 고마워.사진을 다른 앱에 공유하기
private ShareActionProvider mShareActionProvider;
private void dragonFile(){
Bitmap dragonFront = BitmapFactory.decodeResource(getResources(),R.drawable.phoenix_art);
String extStorageDirectory = Environment.getExternalStorageDirectory().toString();
OutputStream outputStream = null;
File file = new File(extStorageDirectory, "phoenix_art.jpeg");
try{
outputStream = new FileOutputStream(file);
dragonFront.compress(Bitmap.CompressFormat.JPEG, 90, outputStream);
outputStream.flush();
outputStream.close();
} catch (Exception e){
e.printStackTrace();
}
private Intent getDefaultShareIntent(){
Intent shareIntent = new Intent();
shareIntent.setType("image/jpeg");
shareIntent.setAction(Intent.ACTION_SEND);
dragonFile();
File downloadedPic = new File(Environment.getExternalStorageDirectory().toString(), "phoenix_art.jpeg");
shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(downloadedPic));
return shareIntent;
}
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
getMenuInflater().inflate(R.menu.share_menu, menu);
MenuItem item = menu.findItem(R.id.menu_item_share);
mShareActionProvider = (ShareActionProvider) item.getActionProvider();
mShareActionProvider.setShareIntent(getDefaultShareIntent());
return super.onCreateOptionsMenu(menu);
}
작성하지 않는 것 같습니다. 그러나 그것은 이상한 일입니다. 그것은 그것을하고 있었다. :/ –
하지만 실제로 파일을 만드는 것 외에 무엇인가하고 있습니까? 파일이 분명히 있습니다. 그렇지 않으면 추가로 넣는 중 오류가 발생합니다. 파일이 실제로 이미지입니까? – Martin