static void n_OnActivityResult_IILandroid_content_Intent_(IntPtr jnienv, IntPtr native__this, int p0, int native_p1, IntPtr native_p2) { global::Artifex.MuPdf.PrintDialogActivity __this = global::Java.Lang.Object.GetObject <global::Artifex.MuPdf.PrintDialogActivity> (jnienv, native__this, JniHandleOwnership.DoNotTransfer); global::Android.App.Result p1 = (global::Android.App.Result)native_p1; global::Android.Content.Intent p2 = global::Java.Lang.Object.GetObject <global::Android.Content.Intent> (native_p2, JniHandleOwnership.DoNotTransfer); __this.OnActivityResult(p0, p1, p2); }
protected override async void OnActivityResult(int requestCode, [GeneratedEnum] global::Android.App.Result resultCode, Intent data) { bool success = resultCode == Result.Ok; if (requestCode == PhotoRequestCode && success) { if (previousFileUri != null && !previousFileUri.ToString().StartsWith("upload")) { try { await ImageService.Instance.LoadFile(previousFileUri.Path).InvalidateAsync(FFImageLoading.Cache.CacheType.All); if (File.Exists(previousFileUri.Path)) { File.Delete(previousFileUri.Path); } previousFileUri = null; } catch (Exception e) { Console.WriteLine("WHY: " + e.Message); } } selectedImage = await AndroidUtils.OnImagePickerResult(resultCode, data, outputFileUri, this, finalImagePath, 1920, 1080); if (selectedImage != null) { ImageService.Instance.LoadFile(selectedImage.Path).Transform(new CircleTransformation()).Into(imageView); } } }
static void n_OnActivityResult_IILandroid_content_Intent_(IntPtr jnienv, IntPtr native__this, int p0, int native_p1, IntPtr native_p2) { global::Com.Huawei.Android.Pushselfshow.Richpush.RichPushActivity __this = global::Java.Lang.Object.GetObject <global::Com.Huawei.Android.Pushselfshow.Richpush.RichPushActivity> (jnienv, native__this, JniHandleOwnership.DoNotTransfer); global::Android.App.Result p1 = (global::Android.App.Result)native_p1; global::Android.Content.Intent p2 = global::Java.Lang.Object.GetObject <global::Android.Content.Intent> (native_p2, JniHandleOwnership.DoNotTransfer); __this.OnActivityResult(p0, p1, p2); }
protected override void OnActivityResult(int requestCode, [GeneratedEnum] global::Android.App.Result resultCode, Intent data) { if (resultCode != Result.Ok || data == null) { return; } switch (requestCode) { case editCollectionIntent: { ActivityCollection returned = JsonConvert.DeserializeObject <ActivityCollection>(data.GetStringExtra("JSON")); if (returned != null) { newCollection = returned; adapter.UpdateActivity(returned); } break; } case addActivityIntent: { LearningActivity added = JsonConvert.DeserializeObject <LearningActivity>(data.GetStringExtra("JSON")); adapter.Collection.Activities.Add(added); adapter.NotifyDataSetChanged(); break; } } }
protected override async void OnActivityResult(int requestCode, [GeneratedEnum] global::Android.App.Result resultCode, Intent data) { bool success = resultCode == global::Android.App.Result.Ok; if (requestCode == photoRequestCode && success) { if (previousFileUri != null) { try { await ImageService.Instance.LoadFile(previousFileUri.Path).InvalidateAsync(FFImageLoading.Cache.CacheType.All); if (File.Exists(previousFileUri.Path)) { File.Delete(previousFileUri.Path); } previousFileUri = null; } catch (Exception e) { Console.WriteLine("WHY: " + e.Message); } } selectedImage = await AndroidUtils.OnImagePickerResult(resultCode, data, outputFileUri, this, finalImagePath, 1920, 1200); ShowImage(); } }
protected override async void OnActivityResult(int requestCode, [GeneratedEnum] global::Android.App.Result resultCode, Intent data) { base.OnActivityResult(requestCode, resultCode, data); if (requestCode == NewReqCode && resultCode == global::Android.App.Result.Ok && File.Exists(outputFileUri.Path)) { AudioLoaded(); } if (requestCode == ExistingReqCode && resultCode == global::Android.App.Result.Ok) { if (data != null && data.Data != null) { UpdateFiles(); System.IO.Stream stream = base.ContentResolver.OpenInputStream(data.Data); if (File.Exists(outputFileUri.Path)) { File.Delete(outputFileUri.Path); } using (var fileStream = File.Create(outputFileUri.Path)) { stream.CopyTo(fileStream); } AudioLoaded(); } } }
protected override void OnActivityResult(int requestCode, [GeneratedEnum] global::Android.App.Result resultCode, Intent data) { if (resultCode != Result.Ok) { return; } switch (requestCode) { case AddTaskIntent: { LearningTask newTask = JsonConvert.DeserializeObject <LearningTask>(data.GetStringExtra("JSON")); adapter.Data.Add(newTask); adapter.NotifyDataSetChanged(); break; } case ManageChildrenIntent: { List <LearningTask> childTasks = JsonConvert.DeserializeObject <List <LearningTask> >(data.GetStringExtra("JSON")); int parentInd = data.GetIntExtra("PARENT", -1); if (parentInd >= 0) { newActivity.LearningTasks.ToList()[parentInd].ChildTasks = childTasks; adapter.UpdateActivity(newActivity); } break; } case EditActivityIntent: { LearningActivity returned = JsonConvert.DeserializeObject <LearningActivity>(data.GetStringExtra("JSON")); if (returned != null) { newActivity = returned; adapter.UpdateActivity(returned); } break; } case EditTaskIntent: { LearningTask returned = JsonConvert.DeserializeObject <LearningTask>(data.GetStringExtra("JSON")); int foundIndex = adapter.Data.FindIndex((LearningTask t) => t.Id == returned.Id); if (foundIndex != -1) { adapter.Data[foundIndex] = returned; adapter.NotifyDataSetChanged(); } break; } } }
protected override void OnActivityResult(int requestCode, [GeneratedEnum] global::Android.App.Result resultCode, Intent data) { // If successful return pass the json data back to the parent activity if (resultCode == global::Android.App.Result.Ok) { Intent myIntent = new Intent(this, typeof(CreateActivityOverviewActivity)); myIntent.PutExtra("JSON", data.GetStringExtra("JSON")); SetResult(global::Android.App.Result.Ok, myIntent); base.Finish(); } }
// Handle files and/or data being returned from launched task activities protected override void OnActivityResult(int requestCode, [GeneratedEnum] global::Android.App.Result resultCode, Intent data) { base.OnActivityResult(requestCode, resultCode, data); if (data == null || resultCode != Result.Ok) { return; } int taskId = data.GetIntExtra("TASK_ID", -1); int resIndex = data.GetIntExtra("RES_INDEX", -1); // deleting from MediaViewerActivity if (data.GetBooleanExtra("IS_DELETE", false) && taskId != -1 && resIndex != -1) { adapter.DeleteFile(taskId, resIndex); return; } string newFile = data.GetStringExtra("FILE_PATH"); string mapLocations = data.GetStringExtra("LOCATIONS"); bool isPoly = data.GetBooleanExtra("IS_POLYGON", false); bool complete = data.GetBooleanExtra("COMPLETE", false); if (resultCode == Result.Ok && taskId != -1 && !string.IsNullOrWhiteSpace(newFile)) { string taskType = adapter.GetTaskWithId(taskId).TaskType.IdName; adapter.OnFileReturned(taskId, newFile, (taskType == "TAKE_PHOTO" || taskType == "MATCH_PHOTO")); } else if (!string.IsNullOrWhiteSpace(mapLocations)) { adapter.OnMapReturned(taskId, mapLocations, isPoly); } else if (complete) { // A task which doesn't return a file or data has been completed (e.g. location hunt) adapter.OnGenericTaskReturned(taskId, true); } else { Toast.MakeText(this, "Error: Unknown task type", ToastLength.Short).Show(); } dbManager.SaveActivityProgress(learningActivity, adapter.Items, enteredName); }
public virtual unsafe void OnActivityResult(int p0, [global::Android.Runtime.GeneratedEnum] global::Android.App.Result p1, global::Android.Content.Intent p2) { if (id_onActivityResult_IILandroid_content_Intent_ == IntPtr.Zero) { id_onActivityResult_IILandroid_content_Intent_ = JNIEnv.GetMethodID(class_ref, "onActivityResult", "(IILandroid/content/Intent;)V"); } try { JValue *__args = stackalloc JValue [3]; __args [0] = new JValue(p0); __args [1] = new JValue((int)p1); __args [2] = new JValue(p2); if (((object)this).GetType() == ThresholdType) { JNIEnv.CallVoidMethod(((global::Java.Lang.Object) this).Handle, id_onActivityResult_IILandroid_content_Intent_, __args); } else { JNIEnv.CallNonvirtualVoidMethod(((global::Java.Lang.Object) this).Handle, ThresholdClass, JNIEnv.GetMethodID(ThresholdClass, "onActivityResult", "(IILandroid/content/Intent;)V"), __args); } } finally { } }
protected override void OnActivityResult(int requestCode, [GeneratedEnum] global::Android.App.Result resultCode, Intent data) { }