问题描述
我可以访问 speedView(getText 很好),但是 setText 不起作用!没有错误,但是speedView的文字没有变化。
activity_ar_navigation 使用 mapBox 视觉。
public LocationCallback locationCallback = new LocationCallback() {
@Override
public void onLocationResult(LocationResult locationResult) {
super.onLocationResult(locationResult);
LayoutInflater inflater1 = LayoutInflater.from(LocationService.this);
View root = inflater1.inflate(R.layout.activity_ar_navigation,null,true);
TextView speedView = (TextView)root.findViewById(R.id.speed);
speedView.setText("this is a test");
(.....)
}
};
`
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.mapBox.vision.ar.view.gl.VisionArView
android:id="@+id/mapBox_ar_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<TextView
android:id="@+id/speed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginLeft="20dp"
android:textSize="30dp"
android:textColor="@android:color/holo_green_light"
android:background="@color/white"
android:text=""/>
</FrameLayout>
有什么想法吗?提前致谢!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)