【问题标题】:Display near by places in Location based Augmented reality Android在基于位置的增强现实 Android 中显示附近地点
【发布时间】: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


【解决方案1】:

您好,我认为您可能没有正确声明 lib,或者您没有在 java 文件中初始化 RadarView 对象,因此您想正确检查它或尝试调试它,因为您遇到空对象引用异常。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-09-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-05
    • 2011-12-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多