gpt4 book ai didi

android - 如何自定义分享 Intent ?

转载 作者:行者123 更新时间:2023-11-30 02:33:55 25 4
gpt4 key购买 nike

我的应用程序中已经集成了一个共享按钮,但我不想共享链接(我正在使用 Webview),而是想共享自定义文本,例如“要获取更多信息,请从 Android 商店 PLAYSTORELINK 下载 APPNAME”

    private void sharePost() {
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(Intent.EXTRA_TEXT, mUri);
startActivity(Intent.createChooser(shareIntent, getString(R.string.share_chooser_method)));
}
}

最佳答案

替换:

shareIntent.putExtra(Intent.EXTRA_TEXT, mUri);

与:

shareIntent.putExtra(Intent.EXTRA_TEXT, "To get more facts download the APPNAME from the android store PLAYSTORELINK");

关于android - 如何自定义分享 Intent ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26875285/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com