the widget is updated by a Broadcast receiver,  not an activity!

On 2月3日, 上午2时07分, Samir <[email protected]> wrote:
> Hi,
> I am attempting to signal my widget such that it receives my new
> Intent from my service
>
> The code I am using to send from the service is as follows:
>
>                 Intent testwidgetintent = new Intent();
>                 testwidgetintent.setAction
> ("android.appwidget.action.APPWIDGET_UPDATE");
>                 testwidgetintent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
>                 applicationcontext.startActivity(testwidgetintent);
>
> The testwidget is defined in my Android Manifest.xml as a broadcast
> receiver as follows
>
>                 <receiver android:name=".testwidget">
>                         <intent-filter>
>                                 <action 
> android:name="android.appwidget.action.APPWIDGET_UPDATE" /
>
>                         </intent-filter>
>                         <meta-data android:name="android.appwidget.provider"
>                                 android:resource="@xml/testwidget" />
>                 </receiver>
>
> From what I can understand from the android SDK online I need to
> signal a new Intent with action APPWIDGET_UPDATE and then if the
> receiver is correctly registered in the Android Manifest.xml then the
> testwidget onUpdate() method should be called and I am not getting any
> logging from this component to indicate this has happened.
>
> The error I get when I call applicationcontext.startActivity
> (testwidgetintent) is ActivityNotFoundException.
>
> Does anyone have any ideas what may be going wrong, I have managed to
> create a StatusBar notification with a PendingIntent to launch a new
> Activity from the same method in my service so I had assumed that
> signalling my appwidgetprovider might be similar?
>
> Thanks in advance
>
> Samir

-- 
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