Quellcode durchsuchen

修改友盟出现的bug

xieshengqi vor 5 Jahren
Ursprung
Commit
77bed97491

+ 1 - 0
app/src/main/java/com/kuxuan/moneynote/MyApplication.java

@@ -111,6 +111,7 @@ public class MyApplication extends MultiDexApplication {
111 111
         UMConfigure.init(this, UMConfigure.DEVICE_TYPE_PHONE, null);
112 112
         UMUtils.setChannel(this, BuildConfig.CHANNLE);
113 113
         //设置友盟采集模式
114
+
114 115
         MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.LEGACY_MANUAL);
115 116
 //友盟支持在子线程中统计自定义事件
116 117
         UMConfigure.setProcessEvent(true);

+ 5 - 2
app/src/main/java/com/kuxuan/moneynote/ui/activitys/category/CategoryPresent.java

@@ -124,9 +124,12 @@ public class CategoryPresent extends CategoryContract.CategoryPresent {
124 124
 //                        return;
125 125
 //                    }
126 126
 //                }
127
-                CategoryList categoryList = mAdapter.getData().get(position);
127
+                if(position<mAdapter.getData().size()){
128
+                    CategoryList categoryList = mAdapter.getData().get(position);
128 129
 //                checkDialog(categoryList.getId(), categoryList.getCategory_type(), position);
129
-                deleteCategory(position, categoryList.getCategory_type(), false);
130
+                    deleteCategory(position, categoryList.getCategory_type(), false);
131
+
132
+                }
130 133
 
131 134
             }
132 135
         });

+ 19 - 17
app/src/main/java/com/kuxuan/moneynote/ui/fragments/MoneyTaskFragmentActivity.java

@@ -206,14 +206,14 @@ private RequestManager mRequestManager;
206 206
             @Override
207 207
             public void onDownloadStart(String s, String s1, String s2, String s3, long l) {
208 208
 //                Log.e("onDownloadStart",s+":"+s1+":"+s2+":"+s3);
209
-                DownLoadManager.downLoadForNoMsg(MoneyTaskFragmentActivity.this, s);
210
-//                try {
211
-//                    Uri uri = Uri.parse(s);
212
-//                    Intent intent = new Intent(Intent.ACTION_VIEW,uri);
213
-//                    startActivity(intent);
214
-//                }catch (Exception e){
215
-//
216
-//                }
209
+//                DownLoadManager.downLoadForNoMsg(MoneyTaskFragmentActivity.this, s);
210
+                try {
211
+                    Uri uri = Uri.parse(s);
212
+                    Intent intent = new Intent(Intent.ACTION_VIEW,uri);
213
+                    startActivity(intent);
214
+                }catch (Exception e){
215
+
216
+                }
217 217
 //                String path = Environment.getExternalStorageDirectory().getAbsolutePath() + "/test.apk";
218 218
 //                Log.e("path", path);
219 219
 //                downLoad(s, path);
@@ -357,14 +357,14 @@ private RequestManager mRequestManager;
357 357
             @Override
358 358
             public void onDownloadStart(String s, String s1, String s2, String s3, long l) {
359 359
 //                Log.e("onDownloadStart",s+":"+s1+":"+s2+":"+s3);
360
-                DownLoadManager.downLoadForNoMsg(MoneyTaskFragmentActivity.this, s);
361
-//                try {
362
-//                    Uri uri = Uri.parse(s);
363
-//                    Intent intent = new Intent(Intent.ACTION_VIEW,uri);
364
-//                    startActivity(intent);
365
-//                }catch (Exception e){
366
-//
367
-//                }
360
+//                DownLoadManager.downLoadForNoMsg(MoneyTaskFragmentActivity.this, s);
361
+                try {
362
+                    Uri uri = Uri.parse(s);
363
+                    Intent intent = new Intent(Intent.ACTION_VIEW,uri);
364
+                    startActivity(intent);
365
+                }catch (Exception e){
366
+
367
+                }
368 368
 //                String path = Environment.getExternalStorageDirectory().getAbsolutePath() + "/test.apk";
369 369
 //                Log.e("path", path);
370 370
 //                downLoad(s, path);
@@ -1244,7 +1244,9 @@ private RequestManager mRequestManager;
1244 1244
      * 加载限时领取弹窗
1245 1245
      */
1246 1246
     private void showLimitDialog() {
1247
-
1247
+        if(isFinishing()){
1248
+            return;
1249
+        }
1248 1250
         final AdDialog adDialog = new AdDialog(this).builder().prepareToShowLimitDialog(ADConstants.AD_OPEN_APP_TIMER).setOnGoldGetListener(new AdDialog.OnGoldGetListener() {
1249 1251
             @Override
1250 1252
             public void getGoldDouble(int task_type, String pk) {

+ 5 - 3
app/src/main/java/com/kuxuan/moneynote/ui/fragments/NewsFindFragment.java

@@ -294,15 +294,17 @@ public class NewsFindFragment extends BaseFragment {
294 294
 
295 295
                         }
296 296
                         time = time * 1000;
297
-                        setTImerCount(time);
297
+                        setTimerCount(time);
298 298
                     }
299 299
                 }
300 300
             }
301 301
         });
302 302
     }
303 303
 
304
-
305
-    private void setTImerCount(final long time) {
304
+    private void setTimerCount(final long time) {
305
+        if(timer_tv==null){
306
+            return;
307
+        }
306 308
         if (time == 0) {
307 309
             timer_tv.setText("签到赚钱");
308 310
         } else {

+ 9 - 1
app/src/main/java/com/kuxuan/moneynote/ui/fragments/goldtab/GoldFragment.java

@@ -6,6 +6,7 @@ import android.content.Intent;
6 6
 import android.graphics.Color;
7 7
 import android.graphics.drawable.Drawable;
8 8
 import android.graphics.drawable.GradientDrawable;
9
+import android.net.Uri;
9 10
 import android.os.Bundle;
10 11
 import android.support.v4.widget.SwipeRefreshLayout;
11 12
 import android.support.v7.widget.LinearLayoutManager;
@@ -312,7 +313,14 @@ public class GoldFragment extends BaseFragment {
312 313
                 if (gameGoldInfo.getLink_type() == 2) {
313 314
                     //直接下载
314 315
                     try {
315
-                        DownLoadManager.downLoadForNoMsg(getActivity(), gameGoldInfo.getUrl());
316
+//                        DownLoadManager.downLoadForNoMsg(getActivity(), gameGoldInfo.getUrl());
317
+                        try {
318
+                            Uri uri = Uri.parse(gameGoldInfo.getUrl());
319
+                            Intent url_intent = new Intent(Intent.ACTION_VIEW,uri);
320
+                            startActivity(url_intent);
321
+                        }catch (Exception e){
322
+
323
+                        }
316 324
                     } catch (Exception e) {
317 325
 
318 326
                     }