|
|
|
@ -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); |
|
|
|
|