Communication between AppWidgetProvider and Configuration Activity

by Justin Anderson » Thu, 19 Nov 2009 16:03:07 GMT


Sponsored Links
 ou will have to have some form of default value for this to work, but here
is how I do it:

When I want to read from SharedPreferences I do this:
SharedPreference prefMgr =
PreferenceManager.getDefaultSharedPreferences(this);
m_curPage = prefMgr.getInt(getString(R.string.wgt_pref_cur_screen_key), 0);

When I want to write to it I do this:
SharedPreference prefMgr =
PreferenceManager.getDefaultSharedPreferences(this);
Editor editor = m_prefMgr.edit();
editor.putInt(this.getString(R.string.wgt_pref_cur_screen_key), m_curPage);
editor.commit();

You don't actually pass an object. SharedPreferences essentially abstracts
out reading to and writing from a file....

Thanks,
Justin

----------------------------------------------------------------------
There are only 10 types of people in the world...
Those who know binary and those who don't.
----------------------------------------------------------------------


On Thu, Nov 19, 2009 at 12:41 AM, Susan <ska...@gmail.com> wrote:

> > >



Communication between AppWidgetProvider and Configuration Activity

by Justin Anderson » Thu, 19 Nov 2009 23:27:46 GMT


 've never used the widget configuration, but if my memory serves me
correctly, you shouldn't need to request an update at the end of your
configuration activity...

Isn't the widget's onUpdate() method called by default by Android after the
configuration activity finishes?

Thanks,
Justin

----------------------------------------------------------------------
There are only 10 types of people in the world...
Those who know binary and those who don't.
----------------------------------------------------------------------


On Thu, Nov 19, 2009 at 1:10 AM, Susan <ska...@gmail.com> wrote:

> > > > >


Sponsored Links


Communication between AppWidgetProvider and Configuration Activity

by David McNicol » Fri, 20 Nov 2009 04:36:02 GMT


  have been working with widgets a wee bit lately, onUpdate() is called when
the configuration completes.


On Thu, Nov 19, 2009 at 3:27 PM, Justin Anderson <janderson....@gmail.com>wrote:

>> > > > >



Other Threads

1. Change wallpaper set time

I begginer about android. I want to make one app. That app's goal is:
I set time. Example 6.00 AM - 11.00. Change wallpaper that sun growup
picture when that time. And in tne evening sunset picture. In the
night starlit sky picture. But I have some problems.
1. I can't check when my set time.
2.(It's very funny :P ) I can't change wallpaper picture.

Please help me. If I will done this app I will put sourse in this
group.

--~--~---------~--~----~------------~-------~--~----~

2. Open email through code in android.

Hi Folks,

Actually I want to open email in the emulator and need to take snap
shot of that mail and need to put it on in my local machine.Could you
please give me some java code to open email in the android emulator.


thanks in advance.

--~--~---------~--~----~------------~-------~--~----~

3. Supl interfaces

4. How to add ListView

5. R.java is not updated

6. How to style my own styleable with a style? (Custom view class with custom attribute)

7. How to style my own styleable with a style? (Custom view class with custom attribute)