onactivityresult

Call JavaFX in Java program and wait for wait to exit before running more code

橙三吉。 提交于 2019-12-11 09:49:30
问题 In my java program i give some options to the user and one of thems calls a JavaFXProgram to display something. I only want to run more code in the Java program when this JavaFX that got called actually exits, it may take 5 seconds, it may take a minute. Ideally what i would like is something like we have in Android. We call startActivityForResult() and then wait for the call of onActivityResult() . How can i achieve similar behaviour in my situation? I have this code that i wrote to try to

onActivityResult not working on fragments

喜夏-厌秋 提交于 2019-12-11 08:47:02
问题 onActivityResult not working with fragments..how to call onActivityResult in a class which extends fragment not fragment activity.Is there any other method similar to onActivityResult in fragments? 回答1: 1. Make sure your code like this: startActivityForResult(intent,req); and not this: getActivity().startActivityForResult(intent,req); 2. Make sure implement your Fragment's onActivityResult: super.onActivityResult(requestCode, resultCode, data); 来源: https://stackoverflow.com/questions/19005193

Why is onActivityResult not called in Android?

独自空忆成欢 提交于 2019-12-11 07:55:45
问题 When I my app is launched I am showing a splash screen. That page is been shown for 10 sec, running on a thread. When it switches over to new activity on a result I want o hit a URL in server and I will be getting a return value which I can use for my further implements. Here is my code: private final int SPLASH_DISPLAY_LENGHT = 1000; new Handler().postDelayed(new Runnable() { @Override public void run() { Log.e("Handler ","run"); Intent myIntent = new Intent(getApplicationContext(),

onActivityResult not getting called for Intent.ACTION_CALL - after user exits the native dialer

余生颓废 提交于 2019-12-11 03:58:04
问题 I am doing this to achieve my actual objective which is https://stackoverflow.com/questions/26477947/how-to-call-a-function-after-android-dialer-has-completed-call-using-phonegap-pl , any help on my current question or actual objective is deeply appreciated This is a phonegap app, after the user exits the dialer and returns to my phonegap app I want the onActivityResult to be called. I am not able to get the onActivityResult to fire for some unknownreason. myDialer.java package org.apache

Android Dialog Fragments and onActivityResult

喜夏-厌秋 提交于 2019-12-11 03:42:53
问题 I have created an application that presents the user with a dialog fragment with two options: Yes and No . Should the user select 'Yes', the app will call a Zxing barscan application that is installed on the device, and return the result. Now, I have a proof of concept for this working. However this proof of concept uses a simple Activity. Therefore I can achieve this Barscan result using activity, not with Dialog Fragment. The code used in the proof of concept is as follows: public void

Camera intent onActivityResult code saves (blank) image even if photo was not accepted by user

爱⌒轻易说出口 提交于 2019-12-10 20:55:11
问题 When the user clicks the cross to not accept the photo, it ends the intent in the same way it does when they accept the photo they took. It saves a file to the device gallery. But it's blank. Shouldn't clicking the cross mean that resultCode != RESULT_OK? Is there one more check I am missing? Thanks. Here's the code. Wait, I'm saving the image before activity result...this is a flawed system, but it was on the official Android Developers website. If someone can suggest a fix I would be very

How to get callback from activity back to fragment using interface

南楼画角 提交于 2019-12-10 16:53:07
问题 I have a fragment, where I have a button to choose an image from a gallery. The gallery is open successfully, but when I choose the image, I do not get the result from activity. So I consider to use a callback (interface). However, I do know how. Could you suggest me something please? interface public interface CallbackListener { void onPhotoTake(String url); } in fragment click @OnClick(R.id.addPhoto) void photo() { if (isStoragePermissionGranted()) { Intent i = new Intent(Intent.ACTION_PICK

onActivityResult in dialog fragment

我只是一个虾纸丫 提交于 2019-12-10 16:38:56
问题 I'm taking photo from dialog fragment. And also I need something like startActivityForResult(takePictureIntent, actionCode); @Override public void onActivityResult(int requestCode, int resultCode, Intent imageReturnedIntent) { super.onActivityResult(requestCode, resultCode, imageReturnedIntent); switch (requestCode) { case SELECT_PHOTO: getActivity(); if (resultCode == Activity.RESULT_OK) { Uri selectedImage = imageReturnedIntent.getData(); String[] filePathColumn = { MediaStore.Images.Media

Video selection from gallery: Limit only videos up to 30 seconds should be selected

ぃ、小莉子 提交于 2019-12-09 20:53:12
问题 How can I control videos up to 30 seconds should be selected else show Toast/Popup. I can get video's path in onActivityResult and can run video but can't get duration. Any suggestion, below is my code: case Utils.REQUEST_CODE_GALLERY_VIDEO: if (resultCode == Activity.RESULT_OK) { Uri selectedVieo = data.getData(); String[] filePathColumn = { MediaStore.Video.Media.DATA }; Cursor cursor = getContentResolver().query(selectedVieo, filePathColumn, null, null, null); cursor.moveToFirst(); int

Fragment disappear after coming back from startActivityForResult

你说的曾经没有我的故事 提交于 2019-12-08 13:40:33
i have a strange problem. i use nested fragment in my code,( 4 level ) Home -> Services -> ServiceDetails -> Upload in the last fragment ( Upload Fragment ) i want to choose image from the gallery or the camera so i wrote the following code to pick the image : switch (which) { case galleryItem: Intent intent = new Intent(); intent.setType("image/*"); intent.setAction(Intent.ACTION_GET_CONTENT); startActivityForResult( Intent.createChooser(intent, “Select Album”, Home.GALLERY_REQUEST); break; case cameraItem: Intent cameraIntent = new Intent( android.provider.MediaStore.ACTION_IMAGE_CAPTURE);