33 lines
1.0 KiB
Java
33 lines
1.0 KiB
Java
package com.uiui.sn.jpush;
|
|
|
|
import android.app.Activity;
|
|
import android.content.Intent;
|
|
import android.os.Bundle;
|
|
import android.view.ViewGroup.LayoutParams;
|
|
import android.widget.TextView;
|
|
|
|
import cn.jpush.android.api.JPushInterface;
|
|
|
|
public class TestActivity extends Activity {
|
|
|
|
@Override
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
super.onCreate(savedInstanceState);
|
|
TextView tv = new TextView(this);
|
|
tv.setText("用户自定义打开的Activity");
|
|
Intent intent = getIntent();
|
|
if (null != intent) {
|
|
Bundle bundle = getIntent().getExtras();
|
|
String title = null;
|
|
String content = null;
|
|
if(bundle!=null){
|
|
title = bundle.getString(JPushInterface.EXTRA_NOTIFICATION_TITLE);
|
|
content = bundle.getString(JPushInterface.EXTRA_ALERT);
|
|
}
|
|
tv.setText("Title : " + title + " " + "Content : " + content);
|
|
}
|
|
addContentView(tv, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
|
|
}
|
|
|
|
}
|