Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
- RemoteViews view = new RemoteViews(context.getPackageName(), R.layout.widget); // A widget.xml-ben van a layout
- Intent intent = new Intent(context, Main.class); // A fő osztályt akrjuk elindítani
- PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);
- view.setOnClickPendingIntent(R.id.widget_layout, pendingIntent); // widget_layout a layout ID-ja
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement