CopyPastor

Detecting plagiarism made easy.

Score: 0.9025880755255172; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2017-07-26
by Jay Patel

Original Post

Original - Posted on 2015-10-23
by Johan



            
Present in both answers; Present only in the new answer; Present only in the old answer;

Xamarin forms runs on one activity, which is most like your main activity.
There are two sample projects that show you how to communicate between native and form parts of the code, which can be found here
1. https://github.com/xamarin/xamarin-forms-samples/tree/master/Forms2Native 2. https://github.com/xamarin/xamarin-forms-samples/tree/master/Native2Forms
However, to answer your question, you would do something like the following

private const int MyRequestCode = 101; //Start activity for result var contactPickerIntent = new Intent(Intent.ActionPick, Android.Provider.ContactsContract.Contacts.ContentUri); context.StartActivityForResult(contactPickerIntent, MyRequestCode);
and then in your main activity (the activity that initializes your xamarin forms application (using global::Xamarin.Forms.Forms.Init(this, bundle);)
protected override void OnActivityResult(int requestCode, Result resultCode, Intent data) { if (requestCode == MyRequestCode && resultCode == Result.Ok) { } }
Xamarin forms runs on one activity, which is most like your main activity.
There are two sample projects that show you how to communicate between native and form parts of the code, which can be found here
1. https://github.com/xamarin/xamarin-forms-samples/tree/master/Forms2Native 2. https://github.com/xamarin/xamarin-forms-samples/tree/master/Native2Forms

However, to answer your question, you would do something like the following
private const int MyRequestCode = 101;
//Start activity for result var contactPickerIntent = new Intent(Intent.ActionPick, Android.Provider.ContactsContract.Contacts.ContentUri); context.StartActivityForResult(contactPickerIntent, MyRequestCode);
and then in your main activity (the activity that initializes your xamarin forms application (using `global::Xamarin.Forms.Forms.Init(this, bundle);`)
protected override void OnActivityResult(int requestCode, Result resultCode, Intent data) { if (requestCode == MyRequestCode && resultCode == Result.Ok) { } }


        
Present in both answers; Present only in the new answer; Present only in the old answer;