我有一個應用程序,需要一個截圖和股份這與股份意圖。每次用戶只想分享圖像時,不要保存多個圖像。下面是我用來保存到SDAndroid:共享位圖不保存到SD
Intent share = new Intent(Intent.ACTION_SEND);
share.setType("image/png");
dir = "file://" + Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "Folder/" + location;
share.putExtra(Intent.EXTRA_STREAM, Uri.parse(dir));
startActivity(Intent.createChooser(share, "Share Image"));
圖像但是我無法弄清楚如何簡單位圖保存,如代碼...
share.putExtra(Intent.EXTRA_STREAM, theBitmap);
有沒有辦法做到這一點不保存圖像?
感謝
這也是我所做的,但我寧願不必使用SD卡(並要求提供外部存儲讀/寫權限)。似乎有一種方法可以通過內部存儲來實現。 – Suragch
這個問答值得一讀http://stackoverflow.com/questions/9049143/android-share-intent-for-a-bitmap-is-it-possible-not-to-save-it-prior-sharing – Suragch