On Aug 24, 1:05 pm, Alex Corbi <a.co...@gmail.com> wrote:

> The question is, how can i register a OnClikListener so i know when
> the user clicks the widget on the desktop

You send it through the RemoteViews object. Here's my code:

        RemoteViews views = new RemoteViews(context.getPackageName(),
R.layout.widget);
        views.setOnClickPendingIntent(R.id.click_target,
PendingIntent.getActivity(
                        context,
                        0,
                        new Intent(context, MyActivity.class).setFlags
(Intent.FLAG_ACTIVITY_NEW_TASK),
                        PendingIntent.FLAG_UPDATE_CURRENT));

As you can see, mine opens a specific activity, but I believe you
could fire any valid Intent.

String
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to