onactivityresult

Pick image from fragment always return resultcode 0 in some devices

╄→гoц情女王★ 提交于 2019-12-25 05:50:06
问题 I trying to pick an image from gallery and set the bitmap to my imageview, but I have a problem: in my device, works well, but it doesn't work in other. I start the image picker in my fragment as follow: Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); photoPickerIntent.setType("image/*"); startActivityForResult(photoPickerIntent, SELECT_PHOTO); And this is my onActivityResult : @Override public void onActivityResult(int requestCode, int resultCode, Intent imageReturnedIntent) {

Issue in capture image using camera in lollipop

倾然丶 夕夏残阳落幕 提交于 2019-12-25 03:36:28
问题 I have been searching for the following issue for three days My Code is as following private void openCamera () { try { Intent captureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); String fileName = Constants.IMAGE_CAPTURE_FILE_NAME_PREFIX + System.currentTimeMillis() + Constants.IMAGE_FILE_EXT_JPG; mImageFile = new File(FileManager.getInstance().getFileFullName(Constants.IMAGE_FOLDER, fileName)); captureIntent.putExtra(MediaStore.EXTRA_OUTPUT, mImageFile); startActivityForResult

Issue in capture image using camera in lollipop

删除回忆录丶 提交于 2019-12-25 03:36:05
问题 I have been searching for the following issue for three days My Code is as following private void openCamera () { try { Intent captureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); String fileName = Constants.IMAGE_CAPTURE_FILE_NAME_PREFIX + System.currentTimeMillis() + Constants.IMAGE_FILE_EXT_JPG; mImageFile = new File(FileManager.getInstance().getFileFullName(Constants.IMAGE_FOLDER, fileName)); captureIntent.putExtra(MediaStore.EXTRA_OUTPUT, mImageFile); startActivityForResult

onActivityResult for createSignInIntentBuilder() not called when invoked in landscape mode

不想你离开。 提交于 2019-12-25 01:37:33
问题 My entire project was built in Portrait mode with all my activities set with the following option in the AndroidManifest.xml: android:screenOrientation="portrait" However, as setting orientation on FirebaseUI is not possible (as described here), there is a chance for users to SignIn in Landscape mode. When this happens, onActivityResult is never called: public void createSignInIntent() { // [START auth_fui_create_intent] // Choose authentication providers List<AuthUI.IdpConfig> providers =

OnActivityResult is never called

天涯浪子 提交于 2019-12-24 20:39:43
问题 I have two standalone applications. Application A and Application B. I want to start activity in application B from Application A and get the results back. In application B there is one more activity. From B second acitivty i get result to B's first activity. Now I want these result back to Application A. But OnActivityResult in A is never called. Following is the code. Application A: public void onClickBtnToApplicationB(View v) { try { final Intent intent = new Intent(Intent.ACTION_MAIN,

Why is onActivityResult is called before a contact is chosen?

瘦欲@ 提交于 2019-12-24 11:28:31
问题 I'm following the answer https://stackoverflow.com/a/867828/129805 to add a contact picker to my app. The problem is that onActivityResult is immediately invoked with the correct reqCode ( PICK_CONTACT ), but with a resultCode of 0 and a null for data. It is not invoked again, when the user actually picks a contact. The AndroidManifest gives this activity android:launchMode="singleInstance"> as I only ever want there to be one instance. What have I done wrong? MainActivity.java: @Override

onActivityResult() not called after startActivityForResult() with Intent.ACTION_GET_CONTENT

安稳与你 提交于 2019-12-24 05:18:10
问题 I got my main Activity which holds different Fragment 's, one fragment gives the user a possibility to open a DialogFragment . That dialog opens a list of sound files and the dialog also contains a 'Add' button from which the user should be able to add her own soundfile. To do this I thought to use the standard Android file picking functionality and make use of the Intent.ACTION_GET_CONTENT . So I fire away this intent when the user presses the 'Add' button and the Android file picking

onActivityResult doesn't call from viewPager fragment

家住魔仙堡 提交于 2019-12-23 10:09:11
问题 Hi I am using viewPager with fragmnets inside main fragment. I am trying to get image to bitmap from gallery or from camera, but after picking photo and startActivityForResult it doesn't catch in onActivityResult... here is how i call startActivityForResult: private void setAvatarDialog(){ final CharSequence[] options = {"Choose from Gallery", "Take Photo" }; String title = getString(R.string.alertDialog_editProfile_updateAvatar_title); String negative = getString(R.string.alertDialog

Can not getIntExtra() at onActivityResult

女生的网名这么多〃 提交于 2019-12-23 03:23:09
问题 I got a problem with sending and receiving int types from one activity to another via Intent; I'm sending it with onActivityResult() function which is placed at the receiving activity. The code: The Sending Activity: Intent ba=new Intent(); MyPoints = fgv.getPoints(); int MP=(int)MyPoints; Log.i("Problem","MyPoints MP = "+MP); ba.putExtra("FocusScore",MP); Log.i("Problem","MyPoints = "+MP); setResult(RESULT_OK,ba); finish(); The Receiving Activity: //At the onClick in order to move the the

Fragment disappear after coming back from startActivityForResult

纵饮孤独 提交于 2019-12-23 01:53:02
问题 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;