map = new hashmap();
jsonobject jsonobject;
try {
jsonobject = new jsonobject(extra);
string type = jsonobject.getstring("type");
map.put("type", type);
} catch (jsonexception e) {
// todo auto-generated catch block
e.printstacktrace();
}
map.put("content", content);
//获取接收到推送时的系统时间
calendar rightnow = calendar.getinstance();
simpledateformat fmt = new simpledateformat("-mm-dd");
string date = fmt.format(rightnow.gettime());
map.put("date", date);
myapp.data.add(map);
//**************解析推送过来的json数据并存放到集合中 end******************
} else if (jpushinterface.action_notification_received.equals(intent
.getaction())) {
system.out.println("收到了通知");
// 在这里可以做些统计,或者做些其他工作
} else if (jpushinterface.action_notification_opened.equals(intent
.getaction())) {
system.out.println("用户点击打开了通知");
// 在这里可以自己写代码去定义用户点击后的行为
intent i = new intent(context, mainactivity.class); // 自定义打开的界面
i.setflags(intent.flag_activity_new_task);
context.startactivity(i);
} else {
log.d(tag, "unhandled intent - " + intent.getaction());
}
}
}