Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="utf-8"?>
- <RelativeLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
- <ImageView
- android:id="@+id/stage"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- />
- </RelativeLayout>
- public class MyWidget extends AppWidgetProvider {
- Bitmap bitmap;
- Bitmap bckgrnd;
- Bitmap over;
- @Override
- public void onEnabled(Context context) {
- super.onEnabled(context);
- RemoteViews widgetView = new RemoteViews(context.getPackageName(),
- R.layout.widget);
- bckgrnd=BitmapFactory.decodeResource(context.getResources(), R.drawable.backgrnd);
- over=BitmapFactory.decodeResource(context.getResources(), R.drawable.human);
- bitmap=bckgrnd.copy(Bitmap.Config.ARGB_8888, true);;
- Canvas c=new Canvas(bitmap);
- c.drawBitmap(over, 50, 50, new Paint());
- widgetView.setImageViewBitmap(R.id.stage, bitmap);
- Log.d("MyLog", "onEnabled");
- }
- ......
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement