메인에서 쓰레드로 gps.class 불러서 gps 연결하려고 합니다.
쓰레드를 스타트 시키면 계속 오류가 납니다. 도와주세요.ㅠㅠ
 
//메인
 
public class main extends Activity {
 
...생략
 
 @Override
 protected void onStart() {
  // TODO Auto-generated method stub
  super.onStart();
  gps thread = new gps(this);
  thread.setDaemon(true);
  thread.start();
    intent = new Intent(this, choicebank.class);
  startActivity(intent);
 }
 }
 
//gps.class
public class gps extends Thread implements LocationListener {
 Address addr;
 Context context;
 Geocoder geoCoder;
 double latPoint = 0;
 double lngPoint = 0;
 Location location;
 LocationManager locmanager;
 mydata mydata = new mydata();
 Location myLocation = null;
 String provider;
 float speed = 0;
 Criteria criteria;
 
 public gps(main a)
 {
  context = a;
 }
 public void GetLocations() {
  if (myLocation != null) {
   latPoint = myLocation.getLatitude();
   lngPoint = myLocation.getLongitude();
   speed = (float) (myLocation.getSpeed() * 3.6);
   try {
    List<Address> addresses;
    addresses = geoCoder.getFromLocation(latPoint, lngPoint, 10);
    addr = addresses.get(0);
    mydata.setmyguk(addr.getCountryName());
    mydata.setmydoo(addr.getAdminArea());
    mydata.setmysi(addr.getLocality());
    mydata.setmydong(addr.getThoroughfare());
    mydata.setmybun(addr.getFeatureName());
    mydata.setfirstnum(addr.getLatitude());
    mydata.setlastnum(addr.getLongitude());
   } catch (IOException e) {
    e.printStackTrace();
   }
  }
 }
 public void onLocationChanged(Location location) {
  // TODO Auto-generated method stub
 }
 public void onProviderDisabled(String provider) {
  // TODO Auto-generated method stub
 }
 public void onProviderEnabled(String provider) {
  // TODO Auto-generated method stub
 }
 public void onStatusChanged(String provider, int status, Bundle extras) {
  // TODO Auto-generated method stub
  
    String stat = ""; switch (status) {
   
    case LocationProvider.AVAILABLE: stat = "사용 가능"; break; case
    LocationProvider.OUT_OF_SERVICE: stat = "서비스 불가"; break; case
    LocationProvider.TEMPORARILY_UNAVAILABLE: stat = "일시적 불능"; break; }
  
    //Toast t = Toast.makeText(context, stat, Toast.LENGTH_LONG); t.show();
  
 }
 @Override
 public void run() {
  // TODO Auto-generated method stub
  super.run();
  // gps 수신
  // 위치관리자 구함
  locmanager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 10000,
    0, this);
  locmanager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER,
    10000, 0, this);
  locmanager = (LocationManager) context
    .getSystemService(android.content.Context.LOCATION_SERVICE);
  
    // 최적 제공자 조사 Criteria criteria = new Criteria();
    criteria.setAccuracy(Criteria.ACCURACY_FINE);// 정확도
    criteria.setPowerRequirement(Criteria.POWER_LOW); // 전원 소비량
    criteria.setAltitudeRequired(false); // 고도 사용여부
    criteria.setBearingRequired(false); //
    criteria.setSpeedRequired(false); // 속도
    criteria.setCostAllowed(true); // 금전적비용
   
    provider = locmanager.getBestProvider(criteria, true);
   
    location = locmanager.getLastKnownLocation(provider);
   
    geoCoder = new Geocoder(context, Locale.KOREAN);
   
    myLocation = location;
   
    GetLocations(); 
   
    try
    {
     Thread.sleep(5000);
     }
    catch(Exception e){
    
    }
 }
}