|
|
|
@ -29,18 +29,12 @@ public class MyBoradCReceiver extends BroadcastReceiver { |
|
|
|
public void onReceive(Context context, Intent intent) { |
|
|
|
try { |
|
|
|
Bundle bundle = intent.getExtras(); |
|
|
|
// 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) { |
|
|
|
|
|
|
|
if (bundle != null) { |
|
|
|
String title = bundle.getString(JPushInterface.EXTRA_NOTIFICATION_TITLE); |
|
|
|
String content = bundle.getString(JPushInterface.EXTRA_ALERT); |
|
|
|
String typetime = bundle.getString(JPushInterface.EXTRA_EXTRA); |
|
|
|
System.out.println("aaa++ttt+++++"+title); |
|
|
|
System.out.println("aaa++ccc+++++"+content); |
|
|
|
System.out.println("aaa++ttt+++++"+typetime); |
|
|
|
|
|
|
|
if (!JPushInterface.ACTION_NOTIFICATION_OPENED.equals(intent.getAction())) { |
|
|
|
NewsBean newsBean = new NewsBean(); |
|
|
|
newsBean.setTitle(title); |
|
|
|
@ -51,12 +45,10 @@ public class MyBoradCReceiver extends BroadcastReceiver { |
|
|
|
newsBean.setType(data.getCategory()); |
|
|
|
newsBean.setRed(1); |
|
|
|
newsBean.save(); |
|
|
|
// 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); |
|
|
|
|