【发布时间】:2020-05-06 16:49:26
【问题描述】:
我想问一下如何从我的底部 HTML 调用 Android Studio 上的活动。
这是我的按钮 html 代码:
<button id="button" class="buttonHome" style="background:url(assets/scan.png)"></button>
这是我的java.activity:
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
this.architectView.onPostCreate();
try {
this.architectView.load("file:///android_asset/cobarealobjek/index.html");
} catch (IOException e) {
e.printStackTrace();
}
}
这是我的.xml:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.geowikitudes.RealObjectActivity">
<com.wikitude.architect.ArchitectView
android:id="@+id/architectView_real"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</com.wikitude.architect.ArchitectView>
</FrameLayout>
【问题讨论】:
标签: javascript java android