Hmm, not sure exactly why it isn't working.  Because you can't know
the state of the remote AppWidgetHostView holding your widget, you
should package up all operations each time you push an update.  You
said in logcat it looks like it's trying to start the activity, could
you paste the couple of lines surrounding that?

Also, if you don't have an <intent-filter> inside the Activity
definition in your manifest, you might need to add the
android:exported="true" flag.

j

On Tue, Apr 28, 2009 at 5:52 PM, [email protected]
<[email protected]> wrote:
>
> As a side note I also tried using LayoutInflator and attaching an
> onClickListener to the imageview manually, but that failed to
> recognise any events. Im guessing here that changes made via a
> layoutinflator will not be picked up by remote views which later use
> that layout?
>
> On Apr 29, 1:19 am, "[email protected]"
> <[email protected]> wrote:
>> I have the following code in a static function in my application
>> widget:
>>
>>                 Intent defineIntent = new Intent(context,
>> ToggleIntentActivity.class);
>>                 PendingIntent pendingIntent = PendingIntent
>>                                 .getActivity(context, 0, defineIntent, 0);
>>
>>                 views.setOnClickPendingIntent(R.id.icon, pendingIntent);
>>
>>                 // Tell the widget manager
>>                 appWidgetManager.updateAppWidget(appWidgetId, views);
>>
>> From the examples it looked as though this was the way to trigger
>> custom activity's based on user clicks on your widgets. However even
>> though Logcat says Starting Activity: Intent {......} my activities on
>> create function never gets called!
>>
>> Note my Activity is as follows:
>>
>> public class ToggleIntentActivity extends Activity {
>>         @Override
>>         protected void onCreate(Bundle savedInstanceState) {
>>                 super.onCreate(savedInstanceState);
>>                 Log.e(QuickerCutWidgetManager.TAG, "On create");
>>         }
>>
>> }
>>
>> Any ideas?
> >
>



-- 
Jeff Sharkey
[email protected]

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

Reply via email to