序列化问题一:PendingIntent 6.0以后无法携带序列化对象
有混合传序列化对象 都会有问题
test(1541726712000l);
private void test(long time) {
Intent intent = getaIntent();
PendingIntent pending = PendingIntent.getBroadcast(ContextProvider.getApplicationContext(),
111,
intent,
PendingIntent.FLAG_UPDATE_CURRENT);
AlarmManager manager = (AlarmManager) (ContextProvider.getApplicationContext()).getSystemService(Context.ALARM_SERVICE);
if (Build.VERSION.SDK_INT >= 19) { //API19以上使用才会准确时间传递
manager.setExact(AlarmManager.RTC, time, pending);
} else {
manager.set(AlarmManager.RTC, time, pending);
}
Log.i(\"info\",\"set:\"+time);
}
private Intent getaIntent() {
Intent intent = new Intent(ContextProvider.getApplicationContext(), AlarmReceiver.class);
TagModel model=new TagModel ();
model.setTagId(\"1111\");
model.setChannelName(\"eeeeee\");
intent.putExtra(\"data\",\"dataaaa\");
intent.putExtra(\"url\", (Serializable) model);
intent.putExtra(\"time\",\"ddddd\");
intent.putExtra(\"jumpKindValue\", \"jumpKindValueqqq\");
intent.putExtra(\"action\", \"show_outside_message\");
return intent;
}
序列化问题:
fastjson序列化内部类对象时,关于序列化内部类时:内部类一定是static内部类,且字段为public,否则不能序列化数据到内部类字段上。
继续阅读与本文标签相同的文章
上一篇 :
系统集成项目管理师 高项论文 项目进度管理
下一篇 :
田渊栋教你读paper的正确姿势
-
SpaceX公司刚刚申请在轨道上再运行3万颗星链卫星
2026-05-18栏目: 教程
-
第三讲,Ceph内部构件
2026-05-18栏目: 教程
-
日本发明AI女友,中国却发明AI主持人,这就是差距!
2026-05-18栏目: 教程
-
《华西通信》行业深度:Wi-Fi6同步5G启航,共享万物互
2026-05-18栏目: 教程
-
不用纠结NSA与SA网络!对于5G手机来说,体验基本一致
2026-05-18栏目: 教程
