Advertisement
PsHegger

WidgetOnClickHelp

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