开发学院手机开发Android 开发 Android 打开 GPS 导航并获取位置信息 阅读

Android 打开 GPS 导航并获取位置信息

 2010-10-19 17:18:28 来源:WEB开发网   
核心提示:41 if (location != null)42 {43 Log.w("Location", "Current altitude = "44 + location.getAltitude());45 Log.w("Location", "Curr
41         if (location != null)
42         {
43           Log.w("Location", "Current altitude = "
44               + location.getAltitude());
45           Log.w("Location", "Current latitude = "
46               + location.getLatitude());
47         }
48         locationManager.removeUpdates(this);
49         locationManager.setTestProviderEnabled(provider, false);
50       }
51
52       @Override
53       public void onProviderDisabled(String provider)
54       {
55         // TODO Auto-generated method stub
56         Log.i("onProviderDisabled", "come in");
57
58       }
59
60       @Override
61       public void onProviderEnabled(String provider)
62       {
63         // TODO Auto-generated method stub
64         Log.i("onProviderEnabled", "come in");
65       }
66
67       @Override
68       public void onStatusChanged(String provider, int status,
69           Bundle extras)
70       {
71         // TODO Auto-generated method stub
72         Log.i("onStatusChanged", "come in");
73
74       }
75
76     };
77      locationManager.requestLocationUpdates(provider, 1000, (float) 1000.0, llistener);
78   }
79
80   protected void onDestroy()
81   {
82     locationManager.removeUpdates(llistener);
83     locationManager.setTestProviderEnabled(provider, false);
84     super.onDestroy();
85   }
 

上一页  1 2 

Tags:Android GPS 导航

编辑录入:爽爽 [复制链接] [打 印]
[]
  • 好
  • 好的评价 如果觉得好,就请您
      100%(1)
  • 差
  • 差的评价 如果觉得差,就请您
      0%(0)
赞助商链接