Browse Source

no message

master
lh 7 years ago
parent
commit
9dc39aa8f7
3 changed files with 25 additions and 12 deletions
  1. +16
    -0
      app/src/main/java/com/qhclh/ytzh/index/JPInfoActivity.java
  2. +4
    -12
      app/src/main/java/com/qhclh/ytzh/index/MyBoradCReceiver.java
  3. +5
    -0
      app/src/main/res/layout/view_jp.xml

+ 16
- 0
app/src/main/java/com/qhclh/ytzh/index/JPInfoActivity.java View File

@ -66,6 +66,8 @@ public class JPInfoActivity extends BaseActivity {
private TextView system_red;
private LinearLayout system_ll;
private TextView typetype;
@Override
protected void onResume() {
super.onResume();
@ -81,6 +83,7 @@ public class JPInfoActivity extends BaseActivity {
system_time = view.findViewById(R.id.system_time);
system_red = view.findViewById(R.id.system_red);
system_ll = view.findViewById(R.id.system_ll);
typetype = view.findViewById(R.id.typetype);
// Glide.with(this).load(newsBeanListsystem.get(0).getUrl()).placeholder(R.mipmap.ic_launcher_round).error(R.mipmap.ic_launcher_round).into(system_pic);
system_title.setText(newsBeanListsystem.get(i).getTitle());
@ -91,6 +94,19 @@ public class JPInfoActivity extends BaseActivity {
} else {
system_red.setVisibility(View.INVISIBLE);
}
typetype.setText(newsBeanListsystem.get(i).getType());
system_ll.setTag(newsBeanListsystem.get(i).getType());
system_ll.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
System.out.println("aaaaaaaaaaa+++++++"+view.getTag());
}
});
jpcontent.addView(view);
}
}


+ 4
- 12
app/src/main/java/com/qhclh/ytzh/index/MyBoradCReceiver.java View File

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


+ 5
- 0
app/src/main/res/layout/view_jp.xml View File

@ -69,6 +69,11 @@
android:layout_marginLeft="@dimen/dp_5"
android:background="@drawable/shape_red"
android:visibility="invisible" />
<TextView
android:id="@+id/typetype"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>


Loading…
Cancel
Save