1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- package com.edufound.mobile.push;
- import android.app.Activity;
- import android.app.AlertDialog;
- import android.content.DialogInterface;
- import android.content.Intent;
- import android.os.Bundle;
- import android.text.TextUtils;
- import com.edufound.mobile.R;
- import com.umeng.message.UmengNotifyClickActivity;
- import org.android.agoo.common.AgooConstants;
- import org.cocos2dx.javascript.util.Logger;
- public class MfrMessageActivity extends UmengNotifyClickActivity {
- Activity mActivity;
- @Override
- protected void onCreate(Bundle bundle) {
- super.onCreate(bundle);
- // setContentView(R.layout.activity_push);
- mActivity = this;
- }
- @Override
- public void onMessage(Intent intent) {
- super.onMessage(intent);
- Bundle bundle = intent.getExtras();
- if (bundle != null) {
- Logger.e("bundle: " + bundle);
- }
- String body = intent.getStringExtra(AgooConstants.MESSAGE_BODY);
- Logger.e("body: " + body);
- if (!TextUtils.isEmpty(body)) {
- // runOnUiThread(() -> ((TextView) findViewById(R.id.tv)).setText(body));
- AlertDialog.Builder builder = new AlertDialog.Builder((this));
- builder.setMessage(body);
- builder.setTitle("消息通知");
- builder.setNegativeButton("确定", new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- dialog.dismiss();
- mActivity.finish();
- }
- });
- }
- }
- }
|