Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android AppWidget RemoteViews工厂意图和putSerializable/putParcelable_Android_Android Intent_Android Appwidget_Remoteview - Fatal编程技术网

Android AppWidget RemoteViews工厂意图和putSerializable/putParcelable

Android AppWidget RemoteViews工厂意图和putSerializable/putParcelable,android,android-intent,android-appwidget,remoteview,Android,Android Intent,Android Appwidget,Remoteview,在我的小部件中,我有集合中意图所需的设置 在方法onUpdate上的我的AppWidgetProvider子类中设置PendingEntTemplate 在我的RemoteViewsFactory getViewAt方法中,我有: Bundle extras = new Bundle(); extras.putInt("pos", position); extras.putInt("date", new DateTime().millisOfDay().get()); //commen

在我的小部件中,我有集合中意图所需的设置 在方法onUpdate上的我的AppWidgetProvider子类中设置PendingEntTemplate

在我的RemoteViewsFactory getViewAt方法中,我有:

 Bundle extras = new Bundle();
 extras.putInt("pos", position);
 extras.putInt("date", new DateTime().millisOfDay().get());

 //comment this to work
 extras.putSerializable("d", new DateTime());

 Intent fillInIntent = new Intent();
 fillInIntent.putExtras(extras);

 // Make it possible to distinguish the individual on-click
 // action of a given item
 row.setOnClickFillInIntent(R.id.list_view_row, fillInIntent);
我面临的问题是,我的活动已经开始,但是getViewAtmethod中没有额外的内容,但是,只要我对这些额外内容进行评论,就会出现新的DateTime;陈述 该活动获得所有其他额外费用,但可包裹额外费用除外, AppWidgets SetOnClickFillinContent不支持Parcelableand Serializable extras的地方是否有文档记录

编辑: Im使用以下意图模板:

 Intent startActivityIntent = new Intent(context, MainActivity.class);
    //startActivityIntent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP |   Intent.FLAG_ACTIVITY_CLEAR_TOP);

    startActivityIntent
            .setAction(Intent.ACTION_VIEW)
            .putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId)
            .setData(Uri.parse(startActivityIntent.toUri(Intent.URI_INTENT_SCHEME)));


    PendingIntent startActivityPendingIntent = PendingIntent
            .getActivity(context, 0, startActivityIntent, PendingIntent.FLAG_UPDATE_CURRENT);

    views.setPendingIntentTemplate(R.id.list, startActivityPendingIntent);

检查您在AppWidgetProvider的PendingEvent中传递的标志类型