Android TextView update
<p>Hi
I am trying to update a textview to notify the user when the GPS coordinates have been logged.
My problem is that I need to access the location infomation from another class and I cannot directly edit the textview from anything apart from the onCreate class.</p>

<p>here is my code:</p>

<pre><code>public class Location extends Activity {
    /** Called when the activity is first created. */

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        LocationManager mlocManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE); 

        LocationListener mlocListener = new MyLocationListener(); 


        mlocManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, 0, 0, mlocListener); 

        } 



        public class MyLocationListener implements LocationListener 

        { 

        private final String TAG = null;

        @Override
        public void onLocationChanged(android.location.Location location) {
            // TODO Auto-generated method stub

              location.getLatitude(); 

                location.getLongitude(); 

                String Text = "My current location is: " + "Latitud = " + location.getLatitude() + "Longitud = " + location.getLongitude();

                try
                {
                    File root = Environment.getExternalStorageDirectory();
                    File gps = new File(root, "log.txt");




                BufferedWriter out = new BufferedWriter(
                        new FileWriter(gps,true)) ;

                TextView tv = (TextView)findViewById(R.id.textView1);
                tv.setText(Text);
                out.write(Text);
                out.write("");
                out.close();

                }


                catch (IOException e) {


                    Log.e(TAG, "Could not write file " + e.getMessage());

                }

        }
</code></pre>

<p>Thanks</p>
