1

I want to share Image and text using ACTION_SEND in android, I'm using below code, I can share only a Image but I can not share Text with it on hike application.

        Intent share = new Intent(Intent.ACTION_SEND);
        share.setType("image/*");

        // share.setPackage("com.hike");

        share.putExtra(android.content.Intent.EXTRA_SUBJECT, "Subject");
        share.putExtra(Intent.EXTRA_TEXT, "Hello " + webView.getUrl());

        /*
         * if (text!=null){ share.putExtra(Intent.EXTRA_TEXT,text); } if
         * (path!=null){ share.putExtra(Intent.EXTRA_STREAM,
         * Uri.fromFile(new File(path))); }
         */

        share.putExtra(Intent.EXTRA_STREAM, BitmapURLFromAssets.getBitmapFromAssets(MainActivity.this, "logo.png"));

        try {
            startActivity(Intent.createChooser(share, ""));

        } catch (android.content.ActivityNotFoundException ex) {
            FireToast.makeToast(MainActivity.this, "hike have not been installed.");
        }
Brijpath
  • 73
  • 1
  • 6

1 Answers1

1

i guess this answer may help you. and for reference hike's package name is

com.bsb.hike

Community
  • 1
  • 1
Nilesh Deokar
  • 2,975
  • 30
  • 53