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

by Xin Zhao » Sat, 07 Mar 2009 08:37:37 GMT


Sponsored Links
 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

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



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

by gymshoe » Wed, 29 Apr 2009 06:09:04 GMT


 see:
 http://www.anddev.org/starting_intent_from_preferences_screen-t4505.html 


This invokes an Intent directly from Preferences XML which is handy.
(Perhaps you could specify ACTION_GET_CONTENT to return a value to
your app, although I have not tried this.)  Invoking the intent works
OK internally, but I have not been able to invoke an activity outside
of my application. For instance, I have not been able to invoke the
generic phone Dialer. I have only been able to invoke activities
defined in my manifest file.  This doesn't seem fair since you can
invoke outside activities through java code using intents...

br,
Jim




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


Sponsored Links


Other Threads

1. Mod: ID-Android akan tampil di ICS 2010 @JCC Senayan, Jakarta

Keren banget nih.
Two thumbs up deh.

----- Original Message ----- From: "Agus Hamonangan" <id.andr...@gmail.com> To: <id-android@googlegroups.com>; <id-android-...@googlegroups.com> Sent: Sunday, April 25, 2010 3:33 PM Subject: [id-android] Mod: ID-Android akan tampil di ICS 2010 @JCC Senayan, Jakarta
Rekan-rekan miliser ID Android yang berbahagia, Untuk pertama kali komunitas tercinta ID Android akan tampil di event akbar Indonesia Celluler Show, rencananya akan ada semacam workshop kecil-kecilan oleh team id-android (Lucky Sebastian,Jakontil,SA,LA dll), semoga terlaksana. Spesial thanks to Bro Rahman Hakim atas kerja kerasnya dan Doorprize dari Sonnyericsson :-) -- Salam, Agus Hamonangan

2. Still life after 12 hours unplugged

Alhamdulillah performance battery masih ok setelah 12 jam di cabut dari
charger.

Firmware masih pake jce.

Salam Brian

http://brian-marjunani.com
http://mixbizniz.blogspot.com

-- 
"Indonesian Android Community [id-android]" 

3. Kloteran Battery Gum Plus & Gum Pro - Available No

4. calling a layout

5. add marker to map with onTouchEvent

6. problem with edittext

7. Programmatically forward-lock an APK?