編寫到這里的時候程序報錯,啥問題
myOrientationListener.setOnOrientationListener(new OnOrientationListener()
{
@Override
public void onOrientationChanged(float x)
{
}
});
myOrientationListener.setOnOrientationListener(new OnOrientationListener()
{
@Override
public void onOrientationChanged(float x)
{
}
});
2017-02-12
定位到非洲的,除了加權(quán)限和so外,應(yīng)該看看自己的手機(jī)gps好不好使,我這破機(jī)子刷了幾次定位失敗都在非洲海里,成功的都顯示正確的位置。
2017-01-24
關(guān)于運行后立即閃退問題的解決辦法
1.首先查看日志報的錯
Caused by:java.lang.SecurityException:Requires READ_PHONE_STATE:Neither user 10211 nor current process has android.permission.READ_PHONE_STATE
2.去Manifest下添加權(quán)限
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
這樣就能顯示地圖了,如果你網(wǎng)不好,估計等會,不然還是全屏白格子。
1.首先查看日志報的錯
Caused by:java.lang.SecurityException:Requires READ_PHONE_STATE:Neither user 10211 nor current process has android.permission.READ_PHONE_STATE
2.去Manifest下添加權(quán)限
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
這樣就能顯示地圖了,如果你網(wǎng)不好,估計等會,不然還是全屏白格子。
2016-12-31
對于那些一點“我的位置”就出現(xiàn)空白的情況,是由于把精度和維度搞錯了,緯度是latitude,精度是lontitude。
在我的位置方法中centerToMylocation() {
LatLng latLng=new LatLng(mLatitude,mLontitude);//注意是緯度在前,精度在后
MapStatusUpdate msu=MapStatusUpdateFactory.newLatLng(latLng);
mBaiduMap.animateMapStatus(msu);
}
在我的位置方法中centerToMylocation() {
LatLng latLng=new LatLng(mLatitude,mLontitude);//注意是緯度在前,精度在后
MapStatusUpdate msu=MapStatusUpdateFactory.newLatLng(latLng);
mBaiduMap.animateMapStatus(msu);
}
2016-11-30