From daffc946b06118893e7efa8b5bd712c152e7dea1 Mon Sep 17 00:00:00 2001 From: lh <1209405678@qq.com> Date: Thu, 28 Dec 2017 10:28:37 +0800 Subject: [PATCH] no message --- .../java/com/qhclh/ytzh/home/MainActivity.java | 10 ++++------ .../com/qhclh/ytzh/index/MyBoradCReceiver.java | 15 ++++++--------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/com/qhclh/ytzh/home/MainActivity.java b/app/src/main/java/com/qhclh/ytzh/home/MainActivity.java index 794bb33..086141d 100644 --- a/app/src/main/java/com/qhclh/ytzh/home/MainActivity.java +++ b/app/src/main/java/com/qhclh/ytzh/home/MainActivity.java @@ -16,7 +16,6 @@ import com.google.gson.Gson; import com.qhclh.ytzh.R; import com.qhclh.ytzh.base.BaseActivity; import com.qhclh.ytzh.bean.DownLoadBean; -import com.qhclh.ytzh.bean.FalgBean; import com.qhclh.ytzh.index.IndexFragment; import com.qhclh.ytzh.index.JPInfoActivity; import com.qhclh.ytzh.index.fumudai.FumudaiFragment; @@ -26,7 +25,6 @@ import com.qhclh.ytzh.utils.ApkUtils; import com.qhclh.ytzh.utils.Urltool; import com.qhclh.ytzh.work.WorkFragment; -import org.litepal.crud.DataSupport; import butterknife.BindView; import butterknife.OnClick; @@ -92,9 +90,9 @@ public class MainActivity extends BaseActivity { @Override protected void initData() { - FalgBean falgBean = new FalgBean(); - falgBean.setFlag(0); - falgBean.save(); +// FalgBean falgBean = new FalgBean(); +// falgBean.setFlag(0); +// falgBean.save(); } @Override @@ -110,7 +108,7 @@ public class MainActivity extends BaseActivity { @Override protected void onDestroy() { super.onDestroy(); - DataSupport.deleteAll(FalgBean.class); +// DataSupport.deleteAll(FalgBean.class); } @OnClick({R.id.ll_index, R.id.ll_work, R.id.ll_me}) diff --git a/app/src/main/java/com/qhclh/ytzh/index/MyBoradCReceiver.java b/app/src/main/java/com/qhclh/ytzh/index/MyBoradCReceiver.java index 36806e4..b1a4d79 100644 --- a/app/src/main/java/com/qhclh/ytzh/index/MyBoradCReceiver.java +++ b/app/src/main/java/com/qhclh/ytzh/index/MyBoradCReceiver.java @@ -1,19 +1,16 @@ package com.qhclh.ytzh.index; import android.content.BroadcastReceiver; -import android.content.ContentValues; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.text.TextUtils; -import com.qhclh.ytzh.bean.FalgBean; import com.qhclh.ytzh.bean.NewsBean; import com.qhclh.ytzh.utils.DateTimeUtil; import org.json.JSONException; import org.json.JSONObject; -import org.litepal.crud.DataSupport; import java.util.Iterator; @@ -33,8 +30,8 @@ public class MyBoradCReceiver extends BroadcastReceiver { // Log.d(TAG, "[MyReceiver] onReceive - " + intent.getAction() + ", extras: " + printBundle(bundle)); // System.out.println("aaa1111111111++++++"+bundle.getString(JPushInterface.EXTRA_EXTRA)); // System.out.println("aaa2222222222++++++"+bundle.getString(JPushInterface.EXTRA_ALERT)); - int flag = DataSupport.findAll(FalgBean.class).get(0).getFlag(); - if (flag ==0) { +// int flag = DataSupport.findAll(FalgBean.class).get(0).getFlag(); +// if (flag ==0) { if (bundle != null) { String title = bundle.getString(JPushInterface.EXTRA_NOTIFICATION_TITLE); String content = bundle.getString(JPushInterface.EXTRA_ALERT); @@ -48,12 +45,12 @@ public class MyBoradCReceiver extends BroadcastReceiver { newsBean.setType("01"); newsBean.setRed(1); newsBean.save(); - ContentValues values = new ContentValues(); - values.put("flag", 1); - DataSupport.updateAll(FalgBean.class, values); +// ContentValues values = new ContentValues(); +// values.put("flag", 1); +// DataSupport.updateAll(FalgBean.class, values); } } - } +// } if (JPushInterface.ACTION_REGISTRATION_ID.equals(intent.getAction())) { String regId = bundle.getString(JPushInterface.EXTRA_REGISTRATION_ID);