我正在尝试在wikitude示例项目中实现一些额外的功能
我尝试的是以下内容:我在“更多”按钮附近的Poi详细信息面板中有按钮(“带我去那里”),当用户点击“带我去那里”按钮时,我想调用一个java方法做一些计算。
在我的js文件中按钮点击方法我有:
var currentMarker = World.currentMarker;
var architectSdkUrlm = "architectsdk://navigation?id=" + encodeURIComponent(currentMarker.poiData.id) + "&title=" + encodeURIComponent(currentMarker.poiData.title);
document.location = architectSdkUrlm;
其中architectSdkUrlm中的“Navigation”是我为计算创建的java类的名称。导航类是:
public class Navigation extends AbstractArchitectCamActivity {
@Override
public ArchitectView.ArchitectUrlListener getUrlListener() {
return new ArchitectView.ArchitectUrlListener() {
@Override
public boolean urlWasInvoked(String uriString) {
Uri invokedUri = Uri.parse(uriString);
// pressed "Take me there" button on POI-detail panel
if ("navigation".equalsIgnoreCase(invokedUri.getHost())) {
Log.d("title",String.valueOf(invokedUri.getQueryParameter("title")) );
/*final Intent navIntent = new Intent(Navigation.this, navigationIntent.class);
navIntent.putExtra(navigationIntent.EXTRAS_KEY_POI_ID, String.valueOf(invokedUri.getQueryParameter("id")) );
navIntent.putExtra(navigationIntent.EXTRAS_KEY_POI_TITILE, String.valueOf(invokedUri.getQueryParameter("title")) );
Navigation.this.startActivity(navIntent);*/
return true;
}
return true;
}
};
}
}
我想知道是否可以通过日志消息从js调用java文件,但我什么都没得到。
你对可能出现的问题有什么了解吗?
感谢。