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

  • Home
  • SEARCH
  • 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 9060353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T15:12:26+00:00 2026-06-16T15:12:26+00:00

I read some problems from other users facing the same problem, but the solutions

  • 0

I read some problems from other users facing the same problem, but the solutions didn’t work for me.
I have defined a TextView in my layout xml:

<TextView
  android:id="@+id/currentLocation"
  android:layout_column="0"
  android:layout_row="14"
  android:text="@string/currentLocation" />

Now in my Activity I get the TextView by

location = (TextView) findViewById(R.id.currentLocation);

In my activity I’m also able to start two other activities (one is a googlemap-View, the other one is the contactlist of the phone). My onActivityResult() method in the main activity looks like the following:

public void onActivityResult(int reqCode, int resultCode, Intent data) {
    super.onActivityResult(reqCode, resultCode, data);

    switch (reqCode) {
        case (PICK_CONTACT) :
            if (resultCode == Activity.RESULT_OK) {
                Uri contactData = data.getData();
                Cursor c =  managedQuery(contactData, null, null, null, null);
                if (c.moveToFirst()) {
                    try{
                        String address = c.getString(c.getColumnIndex(ContactsContract.CommonDataKinds.StructuredPostal.FORMATTED_ADDRESS));
                        convertAddressToLatLon(address);
                    }
                    catch(Exception e){
                        errorDialog.setMessage("Could not get Address. Try another contact or use Google Maps.");
                        errorDialog.show();
                    }

                }
            }
        case (PICK_GMAPS) :
            if (resultCode == Activity.RESULT_OK) {
                Bundle googleData = data.getExtras();
                location.setText(googleData.getString("address"));
            }
        break;
    }
}

In the convertAddressToLatLon(address) method there is also a location.setText(); with definatelly a stringvalue!

So if i return from the googlemap-activity, location-text changes to given input. In the contactactivity part it does not work. But there is no error. It reaches the location.setText() method, but does not change the text. I have no idea whats wrong. its not possible, that there is a wrong character in the string. Even if I put ‘location.setText(“test”)’ after the closing braket of the catch block, it does not work. (again, the program goes into the if(c.moveToFirst()){ part!). I have no idea whats wrong, because like I said the googlepart works correct.

  • 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-16T15:12:28+00:00Added an answer on June 16, 2026 at 3:12 pm

    Found the mistake. I forgot to put a “break;” at the end of the PICK_CONTACT-case. Now its working…

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

Sidebar

Related Questions

I have read some posts having the same problem. I tried to adapt their
I have already read some posts, but no one helped me with my problem.
i try to read Data from an Oracle-Database. The problem is that in some
I have some problem with my open new window popup which it can read
I have seen couple of similar problems with solutions, but I couldn't find one
I'm having some problems implementing an algorithm to read a foreign process' memory. Here
I'm experiencing some problems while trying to read a binary file in C. This
I'm trying to read some OpenGL tutorials on the net. the problem is that
i`ve got a little problem with LINQ. I read out some information via XML-RPC.
I read some tutorial in Google App Engine, in those tutorial there is same

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.