How to refresh an activity? Map View refresh fails

Posted by poeschlorn on Stack Overflow See other posts from Stack Overflow or by poeschlorn
Published on 2010-05-03T06:17:09Z Indexed on 2010/05/03 11:48 UTC
Read the original article Hit count: 319

Filed under:
|
|
|

Hi Guys, after implementing some Android Apps, including several Map activities, I try to refresh the activity when the GPS listener's onLocationChanged() mehtod is called.

I have no idea how to tell the map activity to refresh on its own and display the new coords...

the coords to store will have to be in global values, so that the location listener will have access to it.

In my sample GPS-class (see code below) I just changed the text of a text view....but how to do that in map view?

private class MyLocationListener implements LocationListener {
    @Override
    public void onLocationChanged(Location loc) {
        final TextView tv = (TextView) findViewById(R.id.myTextView);
        if (loc != null) {
            tv.setText("Location changed : Lat: " + loc.getLatitude()
                            + " Lng: " + loc.getLongitude());
        }
    }

I think the solution of this Problem won't be very difficult, but I just need the beginning ;-)

This whole app shall work like a really simple navigation system.

It would be great if someone could help me a little bit further :)

nice greetings, Poeschlorn

© Stack Overflow or respective owner

Related posts about android

Related posts about java