由于App Widget只提供给我们一个可以使用RemoteViews的方法PendingIntent,因此只能采用PendingIntent方法来传递Intent。使用Intent实例化一个PendingIntent,调用PendingIntent的getActivity来启动另一个Activity。
getActivity的最后一个参数:
FLAG_CANCEL_CURRENT:若当前描述的PendingIntent已存在,则取消当前的PendingIntent,重新生成一个。
FLAG_NO_CREATE: 若当前描述的PendingIntent已经存在,则取消重新创建,返回null。
FLAG_ONE_SHOT:指PendingIntent只能使用一次。
FLAG_UPDATE_CURRENT:若当前描述的PendingIntent已经存在,则保留旧的Intent,使用新的Intent数据 替换旧的数据。