Using view in widget
<p>I have created a custom view and drawing a bitmap image. How can i use this view in my widget..Below is the code </p>

<pre><code>public class MyWidget extends AppWidgetProvider {

public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
    for(int i=0 ; i&lt;appWidgetIds.length; i++) {

        int appWidgetId = appWidgetIds[i];

        RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.main);

        views.setImageViewBitmap(   ... );

        appWidgetManager.updateAppWidget(appWidgetId, views);

    }

}

}



public class myCustomView extends View {
Bitmap img;

public myCustomView(Context context) {
    super(context);
    img = BitmapFactory.decodeResource(context.getResources(), R.drawable.myimg);

}

protected void onDraw(Canvas canvas) {

    canvas.drawBitmap( img, 0, 0, new Paint() );

}
</code></pre>
