Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9037989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:22:40+00:00 2026-06-16T09:22:40+00:00

I have an activity that launches another one using startActivityForResult. This step is ok.

  • 0

I have an activity that launches another one using startActivityForResult. This step is ok. Then the second activity has a map and when a button is clicked the geopoint coordinates are passed to a bundle that is used on first activity to fullfil an EditText. The function onActivityResult is runned until the end and then the program crashes and appears a message with “Source not found” on screen.

This is the function on mapActivity:

public void ConfirmLoc(View v){
    double lat = loc.getLatitudeE6()/1E6;
    double lng = loc.getLongitudeE6()/1E6;
    Intent ievloc = new Intent();
    Bundle bevloc = new Bundle();
    bevloc.putDouble("latitude",lat);
    bevloc.putDouble("longitude",lng);
    ievloc.putExtras(bevloc);
    setResult(RESULT_OK,ievloc);
    finish();
}

And this is the onActivityResult on first Activity:

protected void onActivityResult(int requestCode, int resultCode, Intent data){
    if(requestCode==1){
        if(resultCode==RESULT_OK){
            EditText loc= (EditText) findViewById(R.id.LocalizacaoEvento);
            bevloc = data.getExtras();
            if(bevloc!=null){
                String latitud = String.valueOf(bevloc.getDouble("latitude"));
                String longitud = String.valueOf(bevloc.getDouble("longitude"));
                loc.setText(latitud+" , "+longitud,TextView.BufferType.EDITABLE);

            }
        }
        else if(resultCode==RESULT_CANCELED){

        }
    }
}

Can anyone help? thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T09:22:42+00:00Added an answer on June 16, 2026 at 9:22 am

    You need to add the @Override line on top of your onActivityResult method. When you do this, you will also be adding the following line as the first line of the method:

    super.onActivityResult(requestCode, resultCode, data); 
    

    Also ensure that your compiler settings is 1.6 and not 1.5 as by default in Eclipse.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one activity with that launches another activity that has a EditText-view. When
I have an activity that launches another activity with startActivityForResult method. I would like
I have a home activity ActivityA, which has button that creates an intent, sets
I have a button in my app that launches another app (the user can
I have an android application that launches a child Activity under certain situations. Both
I have an activity that appears as a dialog using the following custom theme:
I have a small application that launches a login activity as a sub activity
In my application, I have specified a second activity that can be launched from
I have an app that goes between many different activities. One activity, my main
I have an Android widget that has a configure activity. I also have an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.