【发布时间】:2017-08-18 03:49:54
【问题描述】:
我想尝试对显示地点的基于位置的 AR 进行编码。我在以下链接 Augmented reality android example 中尝试了 android 代码,结果在 Redmi note 3(API 24) Nougat 中出现以下错误。我在 main.xml 中做了一些更改
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/surface_overlay">
<SurfaceView android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/surface_camera" />
</FrameLayout>
错误
08-18 09:15:15.588 32701-32701/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: advisory.arplaces, PID: 32701
java.lang.NullPointerException: Attempt to write to field 'advisory.arplaces.arview.DataView advisory.arplaces.arview.RadarView.view' on a null object reference
at advisory.arplaces.arview.DataView.draw(DataView.java:329)
at advisory.arplaces.arview.RadarMarkerView.onDraw(ARView.java:390)
【问题讨论】:
标签: android android-layout geolocation augmented-reality