자바 초보자라 자바도 잘모르고 안드로이드를 배우려 하는데 어려움이 많네요
아래 updateWithNewLocation의 변수 lat, lng값을 아래 onClick에 전달 Intent 명령으로 다른 Activity로 전달하려고 전역 변수를 사용하였는데 계속 0값이 전달되내요. 무엇이 잘못됐나요.
자바의 개념을 내가 잘 모르는 것 같아요. 보시고 고수들의 수정 바랍니다.

package com.android;

import android.app.Activity;
......

public class WhereAmI extends Activity  implements OnClickListener   {
  
  public static  long locX, locY;
 
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.whereami);
   
    Button button6 =
     (Button)findViewById(R.id.Button06);
         button6.setOnClickListener(this);

    LocationManager locationManager;
    String context = Context.LOCATION_SERVICE;
    locationManager = (LocationManager)getSystemService(context);

    Criteria criteria = new Criteria();
    criteria.setAccuracy(Criteria.ACCURACY_FINE);
    criteria.setAltitudeRequired(false);
    criteria.setBearingRequired(false);
    criteria.setCostAllowed(true);
    criteria.setPowerRequirement(Criteria.POWER_LOW);
    String provider = locationManager.getBestProvider(criteria, true);

   Location location = locationManager.getLastKnownLocation(provider);
    updateWithNewLocation(location);

    locationManager.requestLocationUpdates(provider, 2000, 10,
                                           locationListener);
  }
 
  private final LocationListener locationListener = new LocationListener() {
    public void onLocationChanged(Location location) {
      updateWithNewLocation(location);
    }
 
    public void onProviderDisabled(String provider){
      updateWithNewLocation(null);
    }

    public void onProviderEnabled(String provider){ }
    public void onStatusChanged(String provider, int status,
                                Bundle extras){ }
  };


  public void updateWithNewLocation(Location location) {
    String latLongString;
    TextView myLocationText;
    myLocationText = (TextView)findViewById(R.id.myLocationText);
   
   public static long lat, lng;
   
    if (location != null) {
      lat = (long) (location.getLatitude()* 100000);
      lng = (long) (location.getLongitude()* 100000);  ==> 이 계산 값을
      latLongString = "Lat:" + lat + "\nLong:" + lng;
    } else {
      latLongString = "No location found";
    }
    myLocationText.setText("Your Current Position is:\n" +
                           latLongString);
  }
 
  public void onClick(View v) {

   switch (v.getId()) {
    case  R.id.Button06: {
         Intent intent = new Intent(WhereAmI.this, MspotActivity.class);
                locX=250;         
             locY=(int) (lat);                                              <=== 요기로 보내느려고 하는데 왜 안되는지.......
             
         startActivity(intent);
 break;
    }
   }     
  }


}