[mono-android] selecting contacts
John Murray
john at murray.gb.com
Thu Mar 31 15:23:25 EDT 2011
Jon
The activity for selecting contacts is just a bit of boilerplate I culled
from reading around
It is not like the dialog I created where I do have finish() and setresult()
The button click calls only the following code - don't know how it works but
if produces a contacts list and on selection returns
Intent intent = new Intent(Intent.ActionPick);
intent.SetType(ContactsContract.Contacts.ContentType);
I would like to know more about this so that I could filter the contacts
list but haven't worked that bit out yet
If you can supply any pointers I will understand more
TIA
John Murray
PS and in case my previous post didn't get there - there were no complier
errors when I didn't get the override syntax right
-----Original Message-----
From: monodroid-bounces at lists.ximian.com
[mailto:monodroid-bounces at lists.ximian.com] On Behalf Of Jonathan Pryor
Sent: 31 March 2011 19:42
To: john at murray.gb.com; Discussions related to Mono for Android
Subject: Re: [mono-android] selecting contacts
On Mar 31, 2011, at 2:30 PM, John Murray wrote:
> But it seems to completely ignore the OnActivityResult method
You haven't provided the source for your other activity, thus two questions:
1. Does your other activity call Finish()?
2. Does your other activity call Activity.SetResult()?
The documentation implies [0, 1] that Activity.OnActivityResult() is invoked
before Activity.OnResume() [2] is invoked, which is called when the Activity
may be visible to the user. Thus, Activity.OnActivityResult() can't be
invoked if there is a foreground activity (i.e. it hasn't called
Activity.Finish()), and the launched activity should call
Activity.SetResult() unless a value of Result.Canceled is sufficient.
- Jon
[0]
http://docs.mono-android.net/index.aspx?link=M%3aAndroid.App.Activity.OnActi
vityResult
[1]
http://developer.android.com/reference/android/app/Activity.html#onActivityR
esult(int, int, android.content.Intent)
[2]
http://docs.mono-android.net/index.aspx?link=M%3aAndroid.App.Activity.OnResu
me
_______________________________________________
Monodroid mailing list
Monodroid at lists.ximian.com
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid
More information about the Monodroid
mailing list