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. App Developer Emails

I'm not sure if this is concrete enough to file a bug report or
not...but about 2 in 3 emails I receive about apps I've submitted to
the market are blank.  They always have the subject of one of my apps
and have what looks to be a valid email in the "from" part of the
email.  Just wondering if this could be a bug in the market app.
--~--~---------~--~----~------------~-------~--~----~

2. Cupcakes Email and K9

I noticed the significant (and welcome) fixes to the Email client in the 
Cupcake branch (http://source.android.com/roadmap/cupcake).  Does this 
affect the chances of K9 being merged into the main tree?

The reason I ask is that K9 seems to have some significant improvements 
over the inbuilt client which go beyond what cupcake brings (things like 
handling self signed SSL certs on mail server), and I'd prefer to see 
work going into bringing K9 into the main tree as opposed to brining 
changes from cupcake which may make integrating K9 more difficult..

Al.

-- 
======
Funky Android Limited is registered in England & Wales with the 
company number  6741909. The registered head office is Kemp House, 
152-160 City Road, London,  EC1V 2NX, UK. 

The views expressed in this email are those of the author and not 
necessarily those of Funky Android Limited, it's associates, or it's 
subsidiaries.


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

3. HTTP Post with header

4. Original Android 9-Patch Files (.9.png in android.jar contain no patch marks?)

5. Using Linkify on a TextView and event bubbling

6. Simple Text editor

7. layer interaction of graphics app