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. Abridged summary of android-developers@googlegroups.com - 86 Messages in 33 Topics

please unsubscribe

-- 

2. edit video pixels

Hi All,

        I am new to android and i am currently developing my first
app. in this app i have a functionality like adding color effects to
the video being recorded (like adding red tint, sepia, negative). can
someone please advice me on this.

Thanks in advance,
optimus prime

-- 

3. Google Maps Api for Android Terms of Service info

4. save drawing path as bitmap

5. Home screen widget behavior implementation

6. creating listview in a tabview and changing font for entire application

7. HelloTabWidget sample