I m用 go光图工作。 当我第一次提出申请时,就会发现错误。 我点击了部队的近距离,再次照亮,第二次照亮。 这是我的标志:
08-17 07:06:35.288: ERROR/vold(26): Error opening switch name path /sys/class/switch/test (No such file or directory)
08-17 07:06:35.288: ERROR/vold(26): Error bootstrapping switch /sys/class/switch/test (No such file or directory)
08-17 07:06:35.288: ERROR/vold(26): Error opening switch name path /sys/class/switch/test2 (No such file or directory)
08-17 07:06:35.288: ERROR/vold(26): Error bootstrapping switch /sys/class/switch/test2 (No such file or directory)
08-17 07:06:43.888: ERROR/BatteryService(51): usbOnlinePath not found
08-17 07:06:43.888: ERROR/BatteryService(51): batteryVoltagePath not found
08-17 07:06:43.888: ERROR/BatteryService(51): batteryTemperaturePath not found
08-17 07:06:43.908: ERROR/SurfaceFlinger(51): Couldn t open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake
08-17 07:06:47.309: ERROR/EventHub(51): could not get driver version for /dev/input/mouse0, Not a typewriter
08-17 07:06:47.309: ERROR/EventHub(51): could not get driver version for /dev/input/mice, Not a typewriter
08-17 07:06:47.539: ERROR/System(51): Failure starting core service
08-17 07:06:47.539: ERROR/System(51): java.lang.SecurityException
08-17 07:06:47.539: ERROR/System(51): at android.os.BinderProxy.transact(Native Method)
08-17 07:06:47.539: ERROR/System(51): at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)
08-17 07:06:47.539: ERROR/System(51): at android.os.ServiceManager.addService(ServiceManager.java:72)
08-17 07:06:47.539: ERROR/System(51): at com.android.server.ServerThread.run(SystemServer.java:176)
08-17 07:06:47.548: ERROR/AndroidRuntime(51): Crash logging skipped, no checkin service
08-17 07:06:52.005: ERROR/ActivityThread(93): Failed to find provider info for android.server.checkin
08-17 07:06:52.905: ERROR/ActivityThread(93): Failed to find provider info for android.server.checkin
08-17 07:06:52.974: ERROR/ActivityThread(93): Failed to find provider info for android.server.checkin
08-17 07:06:54.728: ERROR/vold(26): Cannot start volume /sdcard (volume is not bound)
08-17 07:06:54.934: ERROR/MediaPlayerService(30): Couldn t open fd for content://settings/system/notification_sound
08-17 07:06:54.944: ERROR/MediaPlayer(51): Unable to to create media player
08-17 07:06:57.375: ERROR/ActivityThread(51): Failed to find provider info for com.google.settings
08-17 07:06:57.375: ERROR/ActivityThread(51): Failed to find provider info for com.google.settings
08-17 07:07:00.225: ERROR/AndroidRuntime(207): ERROR: thread attach failed
08-17 07:07:01.955: ERROR/AndroidRuntime(220): ERROR: thread attach failed
08-17 07:07:07.805: ERROR/ActivityThread(233): Failed to find provider info for com.google.settings
08-17 07:07:07.805: ERROR/ActivityThread(233): Failed to find provider info for com.google.settings
08-17 07:07:07.885: ERROR/ActivityThread(233): Failed to find provider info for com.google.settings
08-17 07:07:08.265: ERROR/AndroidRuntime(233): Uncaught handler: thread main exiting due to uncaught exception
08-17 07:07:08.275: ERROR/AndroidRuntime(233): java.lang.RuntimeException: Unable to start activity ComponentInfo{test.projekat/test.projekat.TrenutnaLokacija}: java.lang.NullPointerException
08-17 07:07:08.275: ERROR/AndroidRuntime(233): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
08-17 07:07:08.275: ERROR/AndroidRuntime(233): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
08-17 07:07:08.275: ERROR/AndroidRuntime(233): at android.app.ActivityThread.access$2200(ActivityThread.java:119)
08-17 07:07:08.275: ERROR/AndroidRuntime(233): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
08-17 07:07:08.275: ERROR/AndroidRuntime(233): at android.os.Handler.dispatchMessage(Handler.java:99)
08-17 07:07:08.275: ERROR/AndroidRuntime(233): at android.os.Looper.loop(Looper.java:123)
08-17 07:07:08.275: ERROR/AndroidRuntime(233): at android.app.ActivityThread.main(ActivityThread.java:4363)
08-17 07:07:08.275: ERROR/AndroidRuntime(233): at java.lang.reflect.Method.invokeNative(Native Method)
08-17 07:07:08.275: ERROR/AndroidRuntime(233): at java.lang.reflect.Method.invoke(Method.java:521)
08-17 07:07:08.275: ERROR/AndroidRuntime(233): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
08-17 07:07:08.275: ERROR/AndroidRuntime(233): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
08-17 07:07:08.275: ERROR/AndroidRuntime(233): at dalvik.system.NativeStart.main(Native Method)
08-17 07:07:08.275: ERROR/AndroidRuntime(233): Caused by: java.lang.NullPointerException
08-17 07:07:08.275: ERROR/AndroidRuntime(233): at test.projekat.TrenutnaLokacija.onCreate(TrenutnaLokacija.java:91)
08-17 07:07:08.275: ERROR/AndroidRuntime(233): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-17 07:07:08.275: ERROR/AndroidRuntime(233): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
08-17 07:07:08.275: ERROR/AndroidRuntime(233): ... 11 more
我的问题是:
08-17 07:07:08.275: ERROR/AndroidRuntime(233): Caused by: java.lang.NullPointerException
08-17 07:07:08.275: ERROR/AndroidRuntime(233): at test.projekat.TrenutnaLokacija.onCreate(TrenutnaLokacija.java:90)
firstDot = new GeoPoint((int) (location.getLatitude()*1E6),(int) (location.getLongitude()*1E6));
我经过编辑的问题......这是我的法典......分配是无效的。 我开始对roid和roid电话进行跟踪。
public void onCreate(Bundle savedInstance){
super.onCreate(savedInstance);
setContentView(R.layout.pocetna);
mapView = (MapView) findViewById(R.id.mapview);
textView = (TextView) findViewById(R.id.text1);
textView3 = (TextView) findViewById(R.id.textView2);
mapController = mapView.getController();
mapController.setZoom(17);
mapView.setStreetView(true);
mapView.setBuiltInZoomControls(true);
button = (Button) findViewById(R.id.button1);
//mapView.setSatellite(true);
sb = (SeekBar) findViewById(R.id.seekBar1);
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
locationListener = new LocationListener() {
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
}
@Override
public void onProviderEnabled(String provider) {
}
@Override
public void onProviderDisabled(String provider) {
updateWithNewLocation(null);
}
@Override
public void onLocationChanged(Location location) {
// TrenutnaLokacija.this.location = location;
updateWithNewLocation(location);
}
};
Criteria criteria = new Criteria();
criteria.setPowerRequirement(Criteria.POWER_LOW);
criteria.setAccuracy(Criteria.ACCURACY_FINE);
provider = locationManager.getBestProvider(criteria, true);
locationManager.requestLocationUpdates(provider, 0, 0, locationListener);
try{
location = locationManager.getLastKnownLocation(provider);
}catch (IllegalArgumentException e) {
Log.d("location", "Greska", e);
}catch (SecurityException s) {
Log.d("dsds", "Greska", s);
}
AlertDialog ad1 = new AlertDialog.Builder(this).create();
ad1.setTitle("Greska");
ad1.setMessage("Trenutno nisu ucitane lokacije");
ad1.setButton(DialogInterface.BUTTON_POSITIVE, "Dozvoli", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface ad, int which) {
}
});
if(location == null){
ad1.show();
Intent i = new Intent(TrenutnaLokacija.this, PronadjiKlopuActivity.class);
startActivity(i);
}
GeoPoint firstDot = new GeoPoint((int) (location.getLatitude()*1E6),(int) (location.getLongitude()*1E6));
myPosition = new NewItemizedOverlay(getResources().getDrawable(R.drawable.map_pin), firstDot);
listOfOverlays = mapView.getOverlays();
listOfOverlays.clear();
listOfOverlays.add(myPosition);