Actually the Widget uses a RemoteView and you service that view in an
AppWidgetProvider which must register one or more BroadcastReceivers
to handle calls from the AppWidgetManager for updated views or your
own events (through Intents).

The Activity is only used for the optional configuration code that is
run when the user installs the widget in the home screen but after
that Activity finishes the system's AppWidgetManager activates your
BroadcastReceivers.

You can do things like register a click listener for the RemoteView
that will invoke either the same config Activity or another Activity
that provides perhaps extended functionality for the App.

If you want to do something like update the Widget at regular
intervals you must implement your own timer using the AlarmManager
with a PendingIntent and a BroadcastReceiver to handle the event when
the alarm is triggered.

Best to keep your own record of the RemoteView to be updated for each
appWidgetId so that your private internal BroadcastReceivers can
update it. You can use the AppWidgetManager.updateAppWidget() at any
time not just when you get the ACTION_UPDATE intent.

Read the documentation:

 http://developer.android.com/guide/topics/appwidgets/index.html



On Feb 2, 12:03 am, TreKing <[email protected]> wrote:
> On Wed, Feb 1, 2012 at 4:08 AM, surabhi jain <[email protected]>wrote:
>
> > I want to run UI thread with widget without using activity class.
>
> OK. And ... ?http://www.catb.org/~esr/faqs/smart-questions.html
>
> Plz help me.
>
> Plz spell "please" correctly.
>
> -------------------------------------------------------------------------------------------------
> TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
> transit tracking app for Android-powered devices

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