Code example for ComponentName

0
                                      R.drawable.die_5,R.drawable.die_6}; 
   
  @Override 
  public void onUpdate(Context ctxt, AppWidgetManager mgr,
                        int[] appWidgetIds) {
    ComponentName me=new ComponentName(ctxt, AppWidget.class);
       
    mgr.updateAppWidget(me, buildUpdate(ctxt, appWidgetIds));
  } 
   
  private RemoteViews buildUpdate(Context ctxt, int[] appWidgetIds) {
    RemoteViews updateViews=new RemoteViews(ctxt.getPackageName(),
                                            R.layout.widget); 
   
    Intent i=new Intent(ctxt, AppWidget.class);
     
    i.setAction(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
    i.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, appWidgetIds);
     
    PendingIntent pi=PendingIntent.getBroadcast(ctxt, 0 , i,
                                                PendingIntent.FLAG_UPDATE_CURRENT);