Questions tagged [onactivityresult]

Called when an activity you launched exits, giving you the requestCode you started it with, the resultCode it returned, and any additional data from it. The resultCode will be RESULT_CANCELED if the activity explicitly returned that, didn't return any result, or crashed during its operation.

Called when an activity you launched exits, giving you the requestCode you started it with, the resultCode it returned, and any additional data from it. The resultCode will be RESULT_CANCELED if the activity explicitly returned that, didn't return any result, or crashed during its operation.

You will receive this call immediately before onResume() when your activity is re-starting.

Click Here for Google Android Documentation

990 questions
-2
votes
1 answer

Not returning to the initial activity

I want to select a text file on my mobile and upload it to Mysql Server. For that I am creating an intent-: public void chooseImage(View v){ Intent intent = new Intent(Intent.ACTION_GET_CONTENT); …
pranav shukla
  • 353
  • 4
  • 15
-2
votes
4 answers

App crashed when the return button is clicked

I'm trying to pass value k from Activity A to B. When the save button in the activity B is clicked, it will pass the value k to Activity A again. But the app crashed if I want to return back to A. Some code snippet in Activity A public void…
Hoo
  • 1,806
  • 7
  • 33
  • 66
-2
votes
1 answer

finish() won't take back from Activity2 to Activity1

I have an app built of two Activities. the main activity (activity 1), using some button, takes you to activity 2 using a startActivityforResult. Activity 2 is a file chooser that chooses some file by clicking on it. once the file is chosen, I want…
Julius
  • 41
  • 5
-2
votes
5 answers

Unable to Instantiate and questions about OnActivityResult

public class MainActivity extends Activity { private static final int GET_MOVIE = 1000; private Button btn1; String movie; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); …
sunsets
  • 401
  • 5
  • 23
-3
votes
2 answers

OnActivityResult not getting called in Fragment where intent pass from adapter class

So in my adapter class, I would like to allow user to capture image fun dispatchTakePictureIntent() { try { val captureIntent = Intent(MediaStore.ACTION_IMAGE_CAPTURE); (context as…
Tony
  • 2,515
  • 14
  • 38
  • 71
-3
votes
2 answers

onActivityResult with different intents?

I have an app where I want to use two buttons, one for opening the camera and the other should open the gallery and select a image. What is the correct way to create the onActivityResult? I started with the camera and it works. I then added the…
Burton
  • 407
  • 1
  • 6
  • 19
-3
votes
1 answer

android onActivityResult and onCreate

I want to know whether onCreate always run at first ? Because in my app, I must set some values in onCreate at first then use them in onActivityResult.
user4254398
  • 373
  • 3
  • 12
-3
votes
5 answers

cant back to OnActivityResult

hey guys i wanted to back to onActivityResult in previous activity here is my code public void onClick(DialogInterface dialog, int id) { Intent i = new Intent(DetailPhotoMedical.this, MedicalClaim.class); …
Borom1r
  • 155
  • 1
  • 7
  • 18
-3
votes
1 answer

fragment's onActivityForResult is not response, specific as fllow

Has a MainActvity,the fragment is inside. The Fragment startActivityForResult to another Activity,and get data setResult() to the Fragment. The Mainctivity's launchMode is defult. But,the Fragment's Method onActivityForResult() is not implement.
-3
votes
3 answers

Android global variable from onActivityResult

How can I create global variable from onActivityResult, I had the result in method but the result is null out method I tried 3 solution :with static variable , By using a singleton class and By Extending the Application class but the same result…
-3
votes
1 answer

onActivityResult not being Overridden and never reached in a Button.ClickListener

I'll start saying I just hope this isn't something so stupid I couldn't notice it, but after hours of researches I haven't found my answer. In my SMSActivity I have created a Button cmdApriRubrica which opens the Contacts default app and then when a…
-3
votes
2 answers

Get data from current activity to previous in android?

This is My Current Activity code Intent i = new Intent(); i.putExtra("BonusScore", score); setResult(Activity.RESULT_OK, i); Now i want BonusScore in previous activity. public void onActivityResult(int requestCode, int resultCode,…
Shabbir Dhangot
  • 8,954
  • 10
  • 58
  • 80
-4
votes
2 answers

Selecting image from gallery as profile picture not working.- onActivityResult()

I am able to view the gallery fine through the dialog, however when I select the image I want it closes the gallery and doesn't appear to update the bitmap on the ImageView, or store it as actualprofilepicture.jpg so I can load it when I want. The…
Hazed 2.0
  • 133
  • 2
  • 14
-4
votes
1 answer

getSupportFragmentManager().getFragments() NPE

I tried to post the Activity's onActivityResult() to its sub-Fragments and got a NPE. I have no idea why the fragment is null. @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { …
Allen Vork
  • 1,536
  • 3
  • 16
  • 29
-6
votes
3 answers

onActivityResult retuens resultcode always -1

I have a fragment from which I call activity and after finishing task, dispose it & comes back to fragment screen. In this, I need to get data back from activity which I'm trying to handle it using onActivityResult but getting resultcode always…
1 2 3
65
66