开发者

MapActivity - Couldn't get connection factory client

I get that message all the time.. I dont think that my mapkey is wrong, cause I can see map, but i cant target to the location I am at..help:

      lmanager=(LocationManager)getSystemService(Context.LOCATION_SERVICE);

    llistener=new MyLocationListener();
    lmanager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, llistener);

}

private class MyLocationListener implements LocationListener
{

    @Override
    public void onLocationChanged(Location location) {
        Toast.makeText(getBaseContext(),"Location", 开发者_运维知识库Toast.LENGTH_LONG).show();
        // TODO Auto-generated method stub
        if(location!=null)
        {
            Toast.makeText(getBaseContext(),"Location changed: "+location.getLatitude()+" lang: "+ location.getLongitude() , Toast.LENGTH_SHORT).show();
        }
         p=new GeoPoint((int)(location.getLatitude()*1E6), (int)(location.getLongitude()*1E6));
        mapC.animateTo(p);
        mapC.setZoom(18);
        mv.invalidate();
    }

    @Override
    public void onProviderDisabled(String provider) {
        // TODO Auto-generated method stub
        //Toast.makeText(getBaseContext(),"Location", Toast.LENGTH_LONG).show(); //I get this toast each time :(
    }

    @Override
    public void onProviderEnabled(String provider) {
        // TODO Auto-generated method stub
        Toast.makeText(getBaseContext(),"Location", Toast.LENGTH_LONG).show();
    }

    @Override
    public void onStatusChanged(String provider, int status, Bundle extras) {
        // TODO Auto-generated method stub
        Toast.makeText(getBaseContext(),"Location", Toast.LENGTH_LONG).show();
    }

}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜