How to start an Intent from preference page AND GET RESULTS?

by Jason Parekh » Wed, 29 Apr 2009 07:17:58 GMT


Sponsored Links
 The easiest solution for your situation is to refresh the summaries in your
preference activity's onResume.

Otherwise you'll have to override onPreferenceTreeClick and start the
activity manually.

(sent from phone)




Hey guys,

I am trying to start an intent from a preference activity, AND GET RESULTS
once the new intent is done. As such, I can update the summary of the
preference.

Normall we do startActivityForResult() to wait for results. But how can I do
this here?

My code is as follow:

      PreferenceScreen intentPref =
getPreferenceManager().createPreferenceScreen(this);
      Intent intent = new Intent(this, PolicyEditor.class);
      intent.putExtra(PhoneCardDbAdapter.COL_ROWID, (long)rule.mRuleID);
      intentPref.setIntent(intent);  <--- I want to make sure once the
activity related to intent is done, we can update the summary
      title = "Rule " + (i+1);
      summary = rule.ruleSummary();
      intentPref.setTitle(title);
      intentPref.setSummary(summary);
      mlaunchPrefCat.addPreference(intentPref);

Any idea?

Thanks,
xin

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



Other Threads

1. virtualbox+ubuntu as Android development enviroment

HI,

Is there any problem in running virtualised-Ubuntu over WinXp machine to 
develop android app?
I have to keep the WinXp to access company stuff. 

tks,
fabiano



      
____________________________________________________________________________________
Veja quais so os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com
--~--~---------~--~----~------------~-------~--~----~

2. Black Berry Pearl 8220 Smart phone

Everything you need for your life on the go is here. With the
BlackBerry Pearl 8220 Smartphone tucked in your pocket, youe always
just a flip away from the people, fun and facts that matter. You've
got pocket-sized entertainment in one package: a media player, camera
and Video recording, Wi-Fi and video streaming, and a large screen
for .. Read More at http://www.oneworldgift.com
--~--~---------~--~----~------------~-------~--~----~

3. Android FTP

4. Video encoding

5. How to set device wide screen orientation

6. DataSource

7. Why did binder report transaction failed?