【问题标题】:How to Share Image and text on hike application using Share Intent in android如何在 android 中使用 Share Intent 在远足应用程序上共享图像和文本
【发布时间】:2016-05-03 08:36:27
【问题描述】:

我想在 android 中使用 ACTION_SEND 共享图像和文本,我正在使用下面的代码,我只能共享一个图像,但我不能在远足应用程序中与它共享文本。

        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.");
        }

【问题讨论】:

    标签: android image android-intent share


    【解决方案1】:

    我猜this 的答案可能会对你有所帮助。并且作为参考远足的包名称是

    com.bsb.hike

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-01-07
      • 2018-05-16
      • 1970-01-01
      • 2015-12-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-16
      相关资源
      最近更新 更多