优化qq分享的粘贴提示
This commit is contained in:
@@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"version": 2,
|
|
||||||
"artifactType": {
|
|
||||||
"type": "APK",
|
|
||||||
"kind": "Directory"
|
|
||||||
},
|
|
||||||
"applicationId": "com.jx.jyhd",
|
|
||||||
"variantName": "processReleaseResources",
|
|
||||||
"elements": [
|
|
||||||
{
|
|
||||||
"type": "SINGLE",
|
|
||||||
"filters": [],
|
|
||||||
"versionCode": 3,
|
|
||||||
"versionName": "3.6.3",
|
|
||||||
"outputFile": "app-release.apk"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -246,7 +246,7 @@ public class QQIntentShareUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Log.d(TAG, "成功启动分享");
|
Log.d(TAG, "成功启动分享");
|
||||||
activity.runOnUiThread(() -> Toast.makeText(activity, "成功启动QQ分享", Toast.LENGTH_SHORT).show());
|
activity.runOnUiThread(() -> Toast.makeText(activity, "已将内容复制到剪贴板,请在QQ中粘贴并分享", Toast.LENGTH_LONG).show());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e(TAG, "启动分享失败: " + e.getMessage());
|
Log.e(TAG, "启动分享失败: " + e.getMessage());
|
||||||
final String msg = "启动分享失败: " + e.getMessage();
|
final String msg = "启动分享失败: " + e.getMessage();
|
||||||
@@ -298,8 +298,14 @@ public class QQIntentShareUtil {
|
|||||||
intent.setComponent(comp);
|
intent.setComponent(comp);
|
||||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
|
||||||
|
try {
|
||||||
|
copyToClipboard(activity, text);
|
||||||
|
} catch (Exception e) {
|
||||||
|
// 忽略异常
|
||||||
|
}
|
||||||
|
|
||||||
activity.startActivity(intent);
|
activity.startActivity(intent);
|
||||||
Toast.makeText(activity, "正在分享到QQ空间", Toast.LENGTH_SHORT).show();
|
Toast.makeText(activity, "已将内容复制到剪贴板,请在QQ空间中粘贴并分享", Toast.LENGTH_LONG).show();
|
||||||
|
|
||||||
// 假设分享成功
|
// 假设分享成功
|
||||||
if (mCallback != null) {
|
if (mCallback != null) {
|
||||||
@@ -318,7 +324,7 @@ public class QQIntentShareUtil {
|
|||||||
|
|
||||||
Intent chooser = Intent.createChooser(intent, "分享到QQ空间");
|
Intent chooser = Intent.createChooser(intent, "分享到QQ空间");
|
||||||
activity.startActivity(chooser);
|
activity.startActivity(chooser);
|
||||||
Toast.makeText(activity, "请从列表中选择QQ", Toast.LENGTH_SHORT).show();
|
Toast.makeText(activity, "已将内容复制到剪贴板,请从列表中选择QQ并粘贴分享", Toast.LENGTH_LONG).show();
|
||||||
|
|
||||||
if (mCallback != null) {
|
if (mCallback != null) {
|
||||||
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||||
@@ -664,10 +670,14 @@ public class QQIntentShareUtil {
|
|||||||
if (!TextUtils.isEmpty(description)) {
|
if (!TextUtils.isEmpty(description)) {
|
||||||
sb.append(description).append("\n\n");
|
sb.append(description).append("\n\n");
|
||||||
}
|
}
|
||||||
|
if (!TextUtils.isEmpty(webUrl)) {
|
||||||
|
sb.append(webUrl);
|
||||||
|
}
|
||||||
|
|
||||||
String text = sb.toString().trim();
|
String text = sb.toString().trim();
|
||||||
|
|
||||||
|
copyToClipboard(activity, text);
|
||||||
|
|
||||||
if (isQzone) {
|
if (isQzone) {
|
||||||
shareTextToQZone(activity, text);
|
shareTextToQZone(activity, text);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user