Adam,
I was recently investigating this issue for my application's widget. My
intent was slightly different - since I tried to update my widget
incrementally, it was necessary to perform a complete update upon
orientation changes.
My conclusions:
- When orientation changes, it's not possible for AppWidgetProvider to
be notified. onUpdate is not called, and neither is any other
notification method.
- The widget's "real" views hosted in home screen process are destroyed
and recreated (as uaual, from xml layout file).
- Android correctly uses appropriate -land or -port layout for the
previous step.
- After the layout is loaded, Android uses the most recent RemoteViews
object (which it saves somewhere) to bring your widget up to date.
Recommendations:
- Create separate layouts for -port and -land orientations.
- Do text trimming in the widget's TextView by specifying its size and
(possibly) "ellipsize" attribute.
- Consequently, do not trim text in the widget provider, or do it so
there is enough left for either layout, the rest should be clipped by
TextView.
- This is the most important: make sure each RemoveViews object you push
to the widget completely specifies widget state, including all
PendingIntents.
-- Kostya Vasilyev
22.05.2010 4:39, Adam Brookman пишет:
There is no Activity running during the orientation change. I would
like it to switch when the user changes the orientation on the Home
Screen.
On Apr 18, 2:31 pm, Anurag Singh<[email protected]> wrote:
Implement OnConfigurationChanged() function of your Activity and also
mention in your manifest as
android:configChanges="orientation"
How can we tell our AppWidget to recalculate the amount of text
displayed on screen orientation change? Is this possible? How would
you solve this problem?
--
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
athttp://groups.google.com/group/android-developers?hl=en
--
Kostya Vasilev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com
--
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