Code example for AppWidgetManager

Methods: updateAppWidget

     * @param views The RemoteViews used to be displayed after the 
     *            AppWidgetManager updating.. 
    public static void updateAppWidgeWithViews(Context context, AppWidgetManager appWidgetManager,
            int appWidgetId, RemoteViews views) {
        appWidgetManager.updateAppWidget(appWidgetId, views);
     * Set the RemoteViews listener here,If the AppWidget need to listener 
     * key/mouse event,you should add the listener here. 
     * @param context The context. 
     * @param remoteViews The RemoteViews need to add listener.  
     * @return The RemoteViews has been added listeneres. 
    public static RemoteViews setRemoteViewListener(Context context, RemoteViews remoteViews) {
        ComponentName componentName = new ComponentName(context,