我想要一个改变 GPS 状态的切换按钮和一个带有 GPS的当前状态。
但是当我实现 LocationListener 和 unimplemente 方法时,例如:
package com.wissen.android;
import android.app.Activity;
import android.location.Location;
import android.location.LocationListener;
import android.os.Bundle;
public class Hello extends Activity implements LocationListener {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
}
public void onLocationChanged(Location arg0) {
// TODO Auto-generated method stub
}
public void onProviderDisabled(String arg0) {
// TODO Auto-generated method stub
}
public void onProviderEnabled(String arg0) {
// TODO Auto-generated method stub
}
public void onStatusChanged(String arg0, int arg1, Bundle arg2) {
// TODO Auto-generated method stub
}
}
我的 Eclipse 编译它但是 android 设备得到:应用程序意外停止...
我认为这真的很容易有人可以帮助我吗? 谢谢你
最佳答案
覆盖onCreate()
方法时需要调用super.onCreate()
关于android - GPS 状态和 TurnOnOff,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8991617/