安卓控件AppWiget 二

来源:互联网 发布:协方差矩阵例子 编辑:程序博客网 时间:2024/05/16 12:18

1、创建pendingIntent方法

2 、RemoteViews的作用

1 remoteViews对象表示了一系列的Viewd对象

2 RemoteViews所表示的对象运行在另外的进程当中

3 向App Widget添加Button

<Button

            android:id="@+id/widgetButtonId"

            android:layout_width=""

            android:layout_height=""

4、为BUtton绑定处理器

remoteViews.setOnClickPendingIntent(R.id.widgetButtonId,pendingIntent);