ソースを参照

修改权限弹出框消失的问题

xieshengqi 5 年 前
コミット
ab64f00c66

+ 1 - 0
app/src/main/AndroidManifest.xml

@@ -6,6 +6,7 @@
6 6
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
7 7
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
8 8
     <uses-permission android:name="android.permission.CALL_PHONE" />
9
+    <uses-permission android:name="android.permission.CAMERA" />
9 10
     <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
10 11
     <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
11 12
     <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

+ 2 - 2
app/src/main/java/com/kuxuan/moneynote/SplashActivity.java

@@ -143,7 +143,6 @@ public class SplashActivity extends FragmentActivity implements WeakHandler.IHan
143 143
             boolean isOpenSplashAd = (boolean) SPUtil.get(this, Constant.System.SWITCH_SPLASH_AD, true);
144 144
             if (isOpenSplashAd) {
145 145
                 boolean isAD = (boolean) SPUtil.get(this, Constant.System.SWITCH_AD, true);
146
-                isAD = false;
147 146
                 if (isAD) {
148 147
                     //加载穿山甲开屏广告
149 148
                     //step2:创建TTAdNative对象
@@ -170,6 +169,7 @@ public class SplashActivity extends FragmentActivity implements WeakHandler.IHan
170 169
         //获取保存的url
171 170
         final String imageUrl = (String) SPUtil.get(this, Constant.System.IMAGE_URL, "");
172 171
         final String linkUrl = (String) SPUtil.get(this, Constant.System.LINK_URL, "");
172
+        final String title = (String) SPUtil.get(this, Constant.System.TITLE_URL, "标题");
173 173
         if(TextUtils.isEmpty(imageUrl)){
174 174
             return;
175 175
         }
@@ -195,7 +195,7 @@ public class SplashActivity extends FragmentActivity implements WeakHandler.IHan
195 195
                         //跳转链接
196 196
                         isClickAd = true;
197 197
                         Intent intent = new Intent(SplashActivity.this, WebviewActivity.class);
198
-                        intent.putExtra(WebviewActivity.TITLE, "广告");
198
+                        intent.putExtra(WebviewActivity.TITLE, title);
199 199
                         intent.putExtra(WebviewActivity.URL, linkUrl);
200 200
                         startActivity(intent);
201 201
 

+ 3 - 0
app/src/main/java/com/kuxuan/moneynote/common/Constant.java

@@ -60,6 +60,8 @@ public class Constant {
60 60
         public static final String IMAGE_URL = "image_url_ad";
61 61
         //自己广告的跳转链接
62 62
         public static final String LINK_URL = "link_url_ad";
63
+        //开屏自己广告位的标题
64
+        public static final String TITLE_URL = "title_url";
63 65
         //开屏广告位开关
64 66
         public static final String SWITCH_SPLASH_AD = "switch_splash_ad";
65 67
         //默认预算
@@ -76,6 +78,7 @@ public class Constant {
76 78
         public static final String CURRENT_GOLD = "current_gold";
77 79
         //首页打开设置
78 80
         public static final String SWITCH_SETTING = "switch_setting";
81
+
79 82
     }
80 83
 
81 84
     /**

+ 6 - 0
app/src/main/java/com/kuxuan/moneynote/ui/activitys/MainActivity.java

@@ -200,6 +200,7 @@ public class MainActivity extends BaseFragmentActivity implements MineFragment.o
200 200
         }
201 201
         GoldManager.getInstance().getUserCoin();
202 202
         getSplashAd();
203
+
203 204
     }
204 205
 
205 206
     /**
@@ -243,6 +244,7 @@ public class MainActivity extends BaseFragmentActivity implements MineFragment.o
243 244
                                     SPUtil.putAndApply(MyApplication.getInstance(), Constant.System.SWITCH_AD, false);
244 245
                                     SPUtil.putAndApply(MyApplication.getInstance(), Constant.System.IMAGE_URL, adJson.getImg_url());
245 246
                                     SPUtil.putAndApply(MyApplication.getInstance(), Constant.System.LINK_URL, adJson.getAdvert_url());
247
+                                    SPUtil.putAndApply(MyApplication.getInstance(), Constant.System.TITLE_URL, adJson.getName());
246 248
                                 }
247 249
                             }
248 250
 
@@ -893,12 +895,16 @@ public class MainActivity extends BaseFragmentActivity implements MineFragment.o
893 895
                         Manifest.permission.WRITE_EXTERNAL_STORAGE,
894 896
                         Manifest.permission.READ_EXTERNAL_STORAGE,
895 897
                         Manifest.permission.CAMERA
898
+
896 899
                 )
897 900
                 .subscribe(new io.reactivex.functions.Consumer<Permission>() {
898 901
                     @Override
899 902
                     public void accept(Permission permission) throws Exception {
900 903
                         if (permission.granted) {
901 904
                             // 用户已经同意该权限
905
+                            if (permission.name.equals("android.permission.READ_PHONE_STATE")) {
906
+                                getIMEI(MainActivity.this);
907
+                            }
902 908
 
903 909
 
904 910
                         } else if (permission.shouldShowRequestPermissionRationale) {

+ 0 - 2
app/src/main/java/com/kuxuan/moneynote/ui/fragments/details/DetialFragment.java

@@ -1021,8 +1021,6 @@ public class DetialFragment extends MVPFragment<DetialPresent, DetialModel> impl
1021 1021
         }catch (Exception e){
1022 1022
 
1023 1023
         }
1024
-
1025
-
1026 1024
     }
1027 1025
 
1028 1026
     @Override