それは私のためにこのエラーを受け取り続け、エミュレーターでは強制終了を示しています。どこがうまくいかなかったのかわからない。実際、私は位置データを取得するためのプログラムを(本を参照して)作成しています。以下は私のプログラムとlogcatエラーです。これらのlink1、link2を参照 しまし たが、それらから解決策を見つけることができませんでした。誰かが私に何が問題なのか教えてもらえますか?私もこれをマニフェストに追加しました
<uses-permission android:name="android.permission.INTERNET"/>
     <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
およびアプリケーションタグ内
<uses-library android:name="com.google.android.maps"/>
これが私の.javaファイルです
public class LBSMap extends MapActivity {
    MapView mapView;
    MapController mc;
    GeoPoint p;
    LocationManager lm;
    LocationListener locationListener;
    private class MapOverlay extends com.google.android.maps.Overlay
    {
        public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when)
        {
            super.draw(canvas, mapView, shadow);
            Point screenPts=new Point();
            mapView.getProjection().toPixels(p, screenPts);
            Bitmap bmp=BitmapFactory.decodeResource(getResources(), R.drawable.pushpin);
            canvas.drawBitmap(bmp, screenPts.x, screenPts.y-50,null);
            return true;
        }
        public boolean onTouchEvent(MotionEvent event,MapView mapView)
        {
            if(event.getAction()==1)
            {
                GeoPoint p=mapView.getProjection().fromPixels((int)event.getX(),(int)event.getY());
            Geocoder geoCoder=new Geocoder(getBaseContext(),Locale.getDefault());
            try{
                List<Address> addresses=geoCoder.getFromLocation(p.getLatitudeE6()/1E6, p.getLongitudeE6()/1E6, 1);
                String add="";
                if(addresses.size()>0)
                {
                    for(int i=0;i<addresses.get(0).getMaxAddressLineIndex();i++)
                        add +=addresses.get(0).getAddressLine(i) + "\n";
                }
                Toast.makeText(getBaseContext(),add,Toast.LENGTH_SHORT).show();
            }catch(IOException e){
                e.printStackTrace();
            }
            return true;
            }
            return false;
        }
    }
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_lbsmap);
        mapView=(MapView)findViewById(R.id.mapView);
        mapView.setBuiltInZoomControls(true);
        mapView.setSatellite(true);
        mapView.setTraffic(true);
        mc=mapView.getController();
        Geocoder geoCoder=new Geocoder(this,Locale.getDefault());
        try{
            List<Address> addresses=geoCoder.getFromLocation(p.getLatitudeE6()/1E6, p.getLongitudeE6()/1E6, 1); //line 103
            String add="";
            if(addresses.size()>0)
            {
                for(int i=0;i<addresses.get(0).getMaxAddressLineIndex();i++)
                    add +=addresses.get(0).getAddressLine(i) + "\n";
            }
            Toast.makeText(getBaseContext(),add,Toast.LENGTH_SHORT).show();
        }catch(IOException e){
            e.printStackTrace();
        }
        MapOverlay mapOverlay=new MapOverlay();
        List<Overlay> listOfOverlays=mapView.getOverlays();
        listOfOverlays.clear();
        listOfOverlays.add(mapOverlay);
        mapView.invalidate();
        lm=(LocationManager)getSystemService(Context.LOCATION_SERVICE);
        locationListener = new MyLocationListener();
    }
    public void onResume()
    {
        super.onResume();
        lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener);
    }
    public void onPause()
    {
        super.onPause();
        lm.removeUpdates(locationListener);
    }
    private class MyLocationListener implements LocationListener
    {
        public void onLocationChanged(Location loc)
        {
            if(loc!=null){
                Toast.makeText(getBaseContext(), "Location changed : Lat: "+loc.getLatitude()+ "Lng: "+loc.getLongitude(), Toast.LENGTH_SHORT).show();
                p=new GeoPoint((int)(loc.getLatitude()*1E6),(int)(loc.getLongitude()*1E6));
                mc.animateTo(p);
                mc.setZoom(18);
            }
        }
        public void onProviderDisabled(String provider)
        {}
        public void onProviderEnabled(String provider)
        {}
        public void onStatusChanged(String provider, int status, Bundle extras)
        {}
    }
    @Override
    public boolean isRouteDisplayed()
    {
        return false;
    }
}
以下はlogcatのスクリーンショットです。
