Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Bitmap bitmap = response.getBitmap();
- File newFile = getActivity().getFilesDir();
- File f = new File(newFile, "share.jpg");
- FileOutputStream fos;
- try {
- fos = getActivity().openFileOutput("share.jpg",Context.MODE_PRIVATE);
- bitmap.compress(Bitmap.CompressFormat.JPEG, 85, fos);
- fos.flush();
- fos.close();
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- Utility.showLog(TAG,e.getLocalizedMessage());
- } catch (IOException e) {
- e.printStackTrace();
- Utility.showLog(TAG,e.getLocalizedMessage());
- }
- Intent intent = new Intent(Intent.ACTION_SEND);
- intent.setType("image/*");
- intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(f));
- intent.putExtra(Intent.EXTRA_SUBJECT, sp.getString(Utility.NAME_KEY, "Guest") + " shared this item with you from KicksExchange");
- intent.putExtra(Intent.EXTRA_TEXT,
- "Check this out on KicksExchange " + pModel.getProductTitle() + " for $" + pModel.getProductPrice() + "\n\nGet the app if you don't have it");
- startActivity(intent);
Add Comment
Please, Sign In to add comment