Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- // Handle item selection
- switch (item.getItemId()) {
- case R.id.item:
- Uri uri = Uri.parse("android.resource://com.jai.desimeme/drawable/");
- Intent shareIntent = new Intent();
- shareIntent.setAction(Intent.ACTION_SEND);
- shareIntent.putExtra(Intent.EXTRA_STREAM, uri);
- shareIntent.setType("image/jpeg");
- startActivity(Intent.createChooser(shareIntent, getResources().getText(R.string.share)));
- return true;
- default:
- return super.onOptionsItemSelected(item);
- }
- }
- BitmapDrawable bm = (BitmapDrawable) yourImageView.getDrawable();
- Bitmap mysharebmp = bm.getBitmap();
- String path = Images.Media.insertImage(getContentResolver(),
- mysharebmp, "MyImage", null);
- Uri uri = Uri.parse(path);
- Intent sharingIntent = new Intent(Intent.ACTION_SEND);
- sharingIntent.setType("image/png");
- sharingIntent.putExtra(Intent.EXTRA_STREAM, uri);
- startActivity(Intent.createChooser(sharingIntent,
- "Share image using"));
- shareIntent.setAction(Intent.ACTION_SEND_MULTIPLE);
- sendIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, imageUris);
Add Comment
Please, Sign In to add comment