|
@@ -96,6 +96,8 @@ public class NewsFindFragment extends BaseFragment {
|
96
|
96
|
@Override
|
97
|
97
|
public void onDestroy() {
|
98
|
98
|
super.onDestroy();
|
|
99
|
+ if (timer_tv != null)
|
|
100
|
+ timer_tv.onCancle();
|
99
|
101
|
EventBus.getDefault().unregister(this);
|
100
|
102
|
}
|
101
|
103
|
|
|
@@ -195,7 +197,7 @@ public class NewsFindFragment extends BaseFragment {
|
195
|
197
|
// bundle.putInt(MainActivity.GO_TYPE, 2);
|
196
|
198
|
// intent.putExtras(bundle);
|
197
|
199
|
// startActivity(intent);
|
198
|
|
- onFinish();
|
|
200
|
+ onFinish();
|
199
|
201
|
}
|
200
|
202
|
});
|
201
|
203
|
checkCanShowGoldTask();
|
|
@@ -240,6 +242,9 @@ public class NewsFindFragment extends BaseFragment {
|
240
|
242
|
@Override
|
241
|
243
|
public void onClick(View v) {
|
242
|
244
|
isCloseGif = true;
|
|
245
|
+ if (timer_tv != null) {
|
|
246
|
+ timer_tv.onCancle();
|
|
247
|
+ }
|
243
|
248
|
gif_layout.setVisibility(View.GONE);
|
244
|
249
|
}
|
245
|
250
|
});
|
|
@@ -299,7 +304,8 @@ public class NewsFindFragment extends BaseFragment {
|
299
|
304
|
timer_tv.setTime(time, new CountDownTimeTextView.OnFinishListener() {
|
300
|
305
|
@Override
|
301
|
306
|
public void onFinish() {
|
302
|
|
- timer_tv.setText("签到赚钱");
|
|
307
|
+ if (timer_tv != null)
|
|
308
|
+ timer_tv.setText("签到赚钱");
|
303
|
309
|
}
|
304
|
310
|
});
|
305
|
311
|
timer_tv.start();
|
|
@@ -319,10 +325,14 @@ public class NewsFindFragment extends BaseFragment {
|
319
|
325
|
for (NewsTypeJson datum : titles) {
|
320
|
326
|
datas.add(NewsFragment.getInstance(datum.getKey()).setMlis(listener));
|
321
|
327
|
}
|
322
|
|
- newsfindViewpager.setOffscreenPageLimit(5);
|
323
|
|
- MyViewPageAdapter viewPageAdapter = new MyViewPageAdapter(getActivity().getSupportFragmentManager(), datas, titles);
|
324
|
|
- newsfindViewpager.setAdapter(viewPageAdapter);
|
325
|
|
- newsfindTablayout.setupWithViewPager(newsfindViewpager);
|
|
328
|
+ try {
|
|
329
|
+ newsfindViewpager.setOffscreenPageLimit(5);
|
|
330
|
+ MyViewPageAdapter viewPageAdapter = new MyViewPageAdapter(getActivity().getSupportFragmentManager(), datas, titles);
|
|
331
|
+ newsfindViewpager.setAdapter(viewPageAdapter);
|
|
332
|
+ newsfindTablayout.setupWithViewPager(newsfindViewpager);
|
|
333
|
+ } catch (Exception e) {
|
|
334
|
+
|
|
335
|
+ }
|
326
|
336
|
}
|
327
|
337
|
|
328
|
338
|
public void onFinish() {
|