gpt4 book ai didi

android - 随机 MapView 强制关闭 : NullPointerException com. google.googlenav.map.Tile.getTile

转载 作者:行者123 更新时间:2023-11-29 22:28:04 26 4
gpt4 key购买 nike

我真的需要一些帮助。我有一个强制关闭此堆栈跟踪的报告,但我找不到任何有关如何预防的信息,也无法复制此类错误。我希望有人能对发生这种情况的原因有所了解。

com.google.googlenav.map.Tile.getTile(Unknown Source)
com.google.googlenav.map.Tile.read(Unknown Source)
com.google.googlenav.map.MapTile.read(Unknown Source)
com.google.googlenav.map.FlashRecord.loadTileFromDataEntry(Unknown Source)
com.google.googlenav.map.FlashRecord.loadTile(Unknown Source)
com.google.googlenav.map.MapFlashService.loadFlashRecordTile(Unknown Source)
com.google.googlenav.map.MapFlashService.getMapTile(Unknown Source)
com.google.googlenav.map.MapService.getTile(Unknown Source)
com.google.googlenav.map.Map.drawTile(Unknown Source)
com.google.googlenav.map.Map.drawMapBackground(Unknown Source)
com.google.googlenav.map.Map.drawMap(Unknown Source)
com.google.android.maps.MapView.drawMap(MapView.java:1048)
com.google.android.maps.MapView.onDraw(MapView.java:486)
android.view.View.draw(View.java:6739)
android.view.ViewGroup.drawChild(ViewGroup.java:1648)
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375)
android.view.View.draw(View.java:6742)
android.view.ViewGroup.drawChild(ViewGroup.java:1648)
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375)
android.view.View.draw(View.java:6742)
android.widget.FrameLayout.draw(FrameLayout.java:352)
android.view.ViewGroup.drawChild(ViewGroup.java:1648)
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375)
android.view.View.draw(View.java:6742)
android.widget.FrameLayout.draw(FrameLayout.java:352)
com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1872)
android.view.ViewRoot.draw(ViewRoot.java:1422)
android.view.ViewRoot.performTraversals(ViewRoot.java:1167)
android.view.ViewRoot.handleMessage(ViewRoot.java:1744)
android.os.Handler.dispatchMessage(Handler.java:99)
android.os.Looper.loop(Looper.java:144)
android.app.ActivityThread.main(ActivityThread.java:4937)
java.lang.reflect.Method.invokeNative(Native Method)
java.lang.reflect.Method.invoke(Method.java:521)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
dalvik.system.NativeStart.main(Native Method)

最佳答案

不是我自己的,但这是修复我的 MapView 崩溃的原因

public class TrackMapView extends MapView {
public TrackMapView(Context context, AttributeSet attrs) {
super(context, attrs);
}

@Override
public void draw(Canvas canvas) {
try {
if(this.getZoomLevel() >= 21) {
this.getController().setZoom(20);
}
super.draw(canvas);
}
catch(Exception ex) {
getController().setCenter(this.getMapCenter());
getController().setZoom(this.getZoomLevel() - 2);
Log.d("TrackMapView", "Internal error in MapView:" + Log.getStackTraceString(ex));
}
}
}

关于android - 随机 MapView 强制关闭 : NullPointerException com. google.googlenav.map.Tile.getTile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5290833/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com