onActivityResult never called

when is onactivityresult called
onactivityresult not called after finish
onactivityresult kotlin
onactivityresult overrides nothing
public void onactivityresult
onactivityresult requestcode
how to call onactivityresult in android
onactivityresult not called in fragment

So far, I used the startActivity function with success and now that I need to use the startActivityResult, I have a problem.

When using this function, the activity I expect to be launched is launched correctly but it seems like the onActivityResult function is never called.

Here is my code in the FriendPicker activity, to lauch the MoodPicker activity:

Intent intent = new Intent(FriendPicker.this, MoodPicker.class);
startActivityForResult(intent, 2);

And here is my code in the MoodPicker activity:

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent)
{                   
    super.onActivityResult(requestCode, resultCode, intent);

    Log.i("in OnActivityResult", "Activity Result");                        

    switch (requestCode)
    {
        case 2:             
            Log.i("in OnActivityResult", "Activity Resut 2");                

            break;
    }
}

and nothing in my logfile is written (I of course, checked that my log file was working properly and double check with a text view output).

Is there something I forgot to declare in the Manifest file?

Thanks in advance.

Did you add the setResult() call in your MoodPicker class ?

Android onActivityResult NEVER called, Try to call the startActivityForResult using the context of the tabgroup activity containing your current activity and then listen in the tabgroup  In my case, I didn’t realize I was calling startActivityForResult from an activity that had the android:noHistory attribute set to true in the manifest. Therefore, the onActivityResult was never called as there was no activity instance anymore.

I had same problem and solved it: Just remove

android:launchMode="singleInstance"

onActivityResult is never called after startActivityForResult · Issue , For activities like turning on Bluetooth or picking a contact, developers must call startActivityForResult, and handle the result in onActivityResult. In the following snippet, tapping the screen starts an activity to pick a contact. The system's contact picker appears, a contact can be selected (or the process cancelled), returning to the app. However, the overridden method onActivityResult never seems to be called. (it also seems that mousePressed() isn't called if there is no draw() function)

In my case, I didn't realize I was calling startActivityForResult from an activity that had the android:noHistory attribute set to true in the manifest. Therefore, the onActivityResult was never called as there was no activity instance anymore.

onActivityResult not being called in callback · Issue #13 · card-io , Running on Samsung S3 Android version 4.1.2 private void launchCardIOScanner(String cardIOAppToken) { Intent scanIntent = new Intent(​this  I have a activity that call another waiting a result (startActivityForResult()), this second activity is just a explanation to the user and independent of he do, I want to open a native screen to make the user allow the permissions that is missing I can open this second activity normally, however the onActivityResult() never is called >:[.

If I am reading this right, all the code referenced needs to be in "FriendPicker". In "MoodPicker" you need code like this that sets the result and ends itself:

this.setResult(SUCCESS_RETURN_CODE, i);
this.finish();

Let me know if this helps...

android onActivityResult never called?, android onActivityResult never called? In my case, I didn't realize I was calling startActivityForResult from an activity that had the android:noHistory attribute set  finish() is inside of the onActivityResult method, so the user never even notices that a transparent activity was called. Update copied from from comments: Activity A calls Activity B via normal intent.

android:noHistory="true" 

like

android:launchMode="singleInstance"

will stop onActivityResult from receive result.

onActivityResult never called, When using this function, the activity I expect to be launched is launched correctly but it seems like the onActivityResult function is never called. Here is my code in​  One of the common problem we always meet in the world of Fragment is: although we could call startActivityForResult directly from Nested Fragment but it appears that onActivityResult would never been called which brought a lot of trouble to handle Activity Result from Nested Fragment.

OnActivityResult not being called after Camera intent, The camera app launches just fine, but the "OnActivityResult" callback is never called so I can't do anything with the captured image. Hardware is a Samsung  Weird thing is that Facebook SDK integration that has similar onActivityResult call works without issues. I'll take deeper look and if I find any solution will post here. And you PayPal guys - if you are hosting on github, it would be useful if you left source code of your SDK instead of doing this silly distribution hosting.

onActivityResult() not called - startActivityForResult(), The file picker successfully launches and I can pick a sound file… But onActivityResult() is not called when returning from an external application (  Starting another activity doesn't have to be one-way. You can also start another activity and receive a result back. To receive a result, call startActivityForResult () (instead of startActivity () ). For example, your app can start a camera app and receive the captured photo as a result. Or, you might start the People app in order for the user

onActivityResult never called for speech Intent on Google Glass , onActivityResult never called for speech Intent on Google Glass - android. it all implemented, but the onActivityResult method apparently never gets called. Android plugin @Override onActivityResult never gets called/invoked. #924. Closed exocom opened this issue Jul 13, 2016 · 11 comments Closed

Comments
  • Please add your solution so that other users reading this post can find useful help.
  • This issue was driving me crazy, well spotted
  • Just wasted a few hours on this. Lifesaver right here.
  • ohhh really very very thanks. i waste my 5 hour for this and finally got it with your solution.
  • I was stuck with this problem for hours. Then I saw your answer and realized I had made the same mistake. Thanks for this answer!
  • YES. Thank you so much.
  • You mean that all the code I wrote should be in the FriendPicker activity? Cause if it is so, there is something I don't get at all in the startActivityForResult process.
  • I tried putting the onActivityResult function in my FriendPicker class and lo log either. I don't get it...
  • onActivityResult() should be placed in the Activity where you called startActivityForResult()
  • android:launchMode="singleTask" poses the same issue.
  • Actually it will work with any requestCode >= 0. Anything negative however doesn't.
  • THANKS!! by mistake I was sending a -1 and the instruction works (I meen it opens the Activity) but then it does not receive data, so you have to add a code >= 0