Re: [android-developers] Android Widget onActive()

2011-07-13 Thread Mark Murphy
On Tue, Jul 12, 2011 at 4:46 PM, cathal coffey  wrote:
> I've created a Widget and I would like to do something every time it
> is on screen.
> By on screen, I mean if the user moves to a screen that contains this
> widget. I want it to fire something like the below function.
>
> @override
> public void onActive(Context context, Intent intent)
> {
>    // Your widget is visible, do something.
> }
>
> Is there a function like this in the Android SDK?

No.

> The Android clock
> widgets seems to function like this, whenever the user moves to a
> screen that has an Andorid clock Widget, it updates it's display to
> show the current time.

That's not an app widget.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training in London: http://bit.ly/smand1, http://bit.ly/smand2

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


[android-developers] Android Widget onActive()

2011-07-12 Thread cathal coffey
Hi Guys,

I've created a Widget and I would like to do something every time it
is on screen.
By on screen, I mean if the user moves to a screen that contains this
widget. I want it to fire something like the below function.

@override
public void onActive(Context context, Intent intent)
{
// Your widget is visible, do something.
}

Is there a function like this in the Android SDK? The Android clock
widgets seems to function like this, whenever the user moves to a
screen that has an Andorid clock Widget, it updates it's display to
show the current time.

Kind regards,
Cathal

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