onactivityresult

Why do I get null in data parmeter of onActivityResult

孤者浪人 提交于 2021-02-17 07:05:45
问题 I use the following code to take picture from the android camera, after taking the pic onActivityResult is called with data parameter equals NULL. Code - public void getpic(View v){ Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); // Ensure that there's a camera activity to handle the intent if (takePictureIntent.resolveActivity(getPackageManager()) != null) { // Create the File where the photo should go File photoFile = null; try { photoFile = createImageFile(); }

Replace gallery image with gallery image in android show too large exception

心已入冬 提交于 2021-02-17 06:01:16
问题 java.lang.RuntimeException: android.os.TransactionTooLargeException: data parcel size 51924760 bytes when one image is select from gallery is work but when i am try to update same image with new image from gallery in android it show this error and application crash Solution for this problem is given below // when you pass bitmap through listview adapter to get this in Fragment imageBitMap = getArguments().getParcelable("bitmapImage"); profileImageView.setImageBitmap(imageBitMap); //Add this

onActivityResult() not executing in fragment when i call startResolutionForResult

谁说我不能喝 提交于 2021-02-07 11:52:06
问题 Problem when i am calling to enable gps programatically using GoogleApiClient into fragment... My code is.. final Status status = result.getStatus(); final LocationSettingsStates state = result.getLocationSettingsStates(); switch (status.getStatusCode()) { case LocationSettingsStatusCodes.SUCCESS: // All location settings are satisfied. The client can initialize location // requests here. getCurrentLocation(); break; case LocationSettingsStatusCodes.RESOLUTION_REQUIRED: // Location settings

Can't get file uri from intent onActivityResult

心已入冬 提交于 2021-01-29 22:40:45
问题 I would like to receive normal file path from onActivityResult like this: override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) if (resultCode == RESULT_OK) { Log.i("m", data!!.dataString!!) convertFileToString(data.dataString!!) } } but I receive such error: java.io.FileNotFoundException: File 'content:/com.android.providers.media.documents/document/image%3A18' does not exist this exception comes from method

OnActivityResult method is deprecated, what is the alternative?

帅比萌擦擦* 提交于 2020-12-25 01:47:47
问题 Recently I faced the onActivtyResult is deprecated . what should we do for handle it? any alternative introduced for that? 回答1: A basic training is available at developer.android.com. Here is an example on how to convert the existing code with the new one: The old way: public void openSomeActivityForResult() { Intent intent = new Intent(this, SomeActivity.class); startActivityForResult(intent, 123); } @Override protected void onActivityResult (int requestCode, int resultCode, Intent data) {

OnActivityResult method is deprecated, what is the alternative?

只愿长相守 提交于 2020-12-25 01:45:14
问题 Recently I faced the onActivtyResult is deprecated . what should we do for handle it? any alternative introduced for that? 回答1: A basic training is available at developer.android.com. Here is an example on how to convert the existing code with the new one: The old way: public void openSomeActivityForResult() { Intent intent = new Intent(this, SomeActivity.class); startActivityForResult(intent, 123); } @Override protected void onActivityResult (int requestCode, int resultCode, Intent data) {

OnActivityResult method is deprecated, what is the alternative?

走远了吗. 提交于 2020-12-25 01:40:21
问题 Recently I faced the onActivtyResult is deprecated . what should we do for handle it? any alternative introduced for that? 回答1: A basic training is available at developer.android.com. Here is an example on how to convert the existing code with the new one: The old way: public void openSomeActivityForResult() { Intent intent = new Intent(this, SomeActivity.class); startActivityForResult(intent, 123); } @Override protected void onActivityResult (int requestCode, int resultCode, Intent data) {

onActivityResult method is not being called

流过昼夜 提交于 2020-02-02 01:02:30
问题 I'm having a problem in my android application. I don't know why 'onActivityResult' method is not being called when 'Up navigation' button from action bar is pressed. I think I've done everything properly: Parent activity launch child activity with 'startActivityForResult' method. Intent intent = new Intent(ParentActivity.this, ChildActivity.class); startActivityForResult(intent, 1000); Parent activity has overridden 'onActivityResult' method. protected void onActivityResult(int requestCode,

doesn't show picture in android 6 and above

强颜欢笑 提交于 2020-01-27 08:47:25
问题 I am trying to learn how to use the camera in an app and this is what I reached , the idea is having a button that opens the camera and that the picture will instantly show on the screen after we take the picture, the second button is from an earlier version that couldn't show the picture immediately and had to be clicked in order to show it. Anyways my problem is that this code doesn't show the picture at android 6.. on my android 5 device it works fine.. the picture is saved in the "sdcard