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. creating custom intent

Hi,
Can anyone tell me what I am doing wrong, I'm sure it is real simple.
I am trying to create a custom intent but everytime I try to launch it
from another activity I get a "No Activity found to handle Intent"
error?  Am I failing to register the new intent somehow even though it
is in the manifest?


Thanks,
Bob

In other activity,produces error:

 Intent i = new Intent("com.example.Intent1");
        startActivity(i);

In Receiver Activity:

In Manifest:

 <receiver android:name=".TestBroadcastReceiver"
android:enabled="true" >
             <intent-filter>
         <action android:name="com.example.Intent1" />

            </intent-filter>
        </receiver>


In Code File:

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class TestBroadcastReceiver extends BroadcastReceiver {

        @Override
        public void onReceive(Context context, Intent intent) {
                // TODO Auto-generated method stub

        }

}

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

2. API to delete SIM contacts & Messages AND erasing the SD card contents

Hi Schimmel,

Thanks for yous advice and suggestions.

What about SIM card tool kit? I read in the cupcake feature list on android
web page.
But now in 1.5 SDK I didnt find any SIM related API.
If any one want to contribute to this, I am ready with my team to develop
the SIM tool kit.

I read in the android developers guide that, we need to sign our application
with the device manufacture's certificate to get the most of the API to
work. Do any one have any info on this?


SD card formatting should be possile as of now with private API in 1.5.
But we can access all the files/dirs on the SD Card and I have written a
java code to delete the files recursively and it is working fine. But the
only problem is that, if u have more data on SD card, that java code takes
more time.
For 500MB it took 5 sec to delete all the files and directories.

Regards
Surendra


On Wed, Apr 29, 2009 at 5:47 PM, brian.schimmel <









-- 
Surendra Reddy T

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

3. Compile problem after repo sync.

4. How to create a file in current directory?

5. Is it possible to call methods of a Activity from service.

6. Several errors with 1.5 + Linux.

7. Is there a recommended method for app updates?