Browse Source

修改剪切板bug

huangxi 5 years ago
parent
commit
586fb96594

+ 4 - 0
app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java

@@ -3188,6 +3188,10 @@ public class CommonUtil {
                     .setBtnLeftText("外部h5").setBtnLeftOnClickListener(view -> Jump2View.getInstance().goWeb(SheepApp.getInstance().getCurrentActivity(), url))
                     .setBtnRightText("内部h5").setBtnRightOnClickListener(view -> Jump2View.getInstance().goWeb(SheepApp.getInstance().getCurrentActivity(), url, "测试内部h5"));
             ViewUtil.showMsgDialog(SheepApp.getInstance().getCurrentActivity(), dialogConfig);
+        } else {
+            dialogConfig.setMsg("已经复制如下内容:\n" + textString + "\n,是否访问该链接?")
+                    .setBtnRightText("确定").setBtnRightOnClickListener(view -> Jump2View.getInstance().goWeb(SheepApp.getInstance().getCurrentActivity(), url, "测试内部h5"));
+            ViewUtil.showMsgDialog(SheepApp.getInstance().getCurrentActivity(), dialogConfig);
         }
     }
 

+ 1 - 1
app/src/main/java/com/sheep/jiuyan/samllsheep/SheepApp.java

@@ -552,7 +552,7 @@ public class SheepApp extends MultiDexApplication {
                 } else {
                     LogUtil.println("onActivityResumed checkCopyText activity", activity.getClass().getSimpleName());
 
-                    CommonUtil.getInstance().checkCopyText();
+                    activity.getWindow().getDecorView().post(() -> CommonUtil.getInstance().checkCopyText());
                     //检查url,实现深度链接
                     Object action = ActionUtil.getInstance().getAction("scheme");
                     if (action instanceof Uri)