Start a new topic

Cannot call architectView.load() more than once

Cannot call architectView.load() more than once


Hi guys,

we want to reuse an ArchitectView by loading several worlds with architectView.load(). But if we call architectView.load() more than once then the image tracking seems to be broken.

You can reproduce the problem by adding the following code to the SampleCamActivity of your provided sample app (WikitudeSDK_Android_5_1_1Examples\SDKExamples). In this case, the just loaded world is reloaded.

In Wikitude SDK 4.1.1 there was no issue.

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

this.architectView.registerWorldLoadedListener(getWorldLoadedListener());
}

boolean executed = false;

public ArchitectView.ArchitectWorldLoadedListener getWorldLoadedListener() {
return new ArchitectView.ArchitectWorldLoadedListener() {

@Override
public void worldWasLoaded(String url) {
try {
if (!executed) {
executed = true;
architectView.load(getARchitectWorldPath());
}
} catch (IOException e) {
e.printStackTrace();
}
}

@Override
public void worldLoadFailed(int errorCode, String description, String failingUrl) {
}
};
}


 

Thanks for your help.

Hi,
Have you tried to destroy all objects in your Architect World before loading a new one?

Best regards

Andreas

Hi Andreas, Thanks for your reply.

We tried to use the method ArchitectView.clearAppCache() to solve this problem but unfortunately not. Are there any other ways to destroy objects within an Architect World?

Bye,

Hieu

Hi,
From within an Architect World, simply call `AR.context.destroyAll()`;.

You could also use architectView.callJavaScript("AR.context.destroyAll();") to clear the architect world from within your Java code.

Best regards

Andreas

Tried "destroyAll()" but still have the problem.

Did you test the code snippet I attached to the first post? In Wikitude SDK 4.1.1 architectView.load() can be called several times with no problem. In Wikitude SDK 5.1.1 after the second call the SDK cannot track images anymore. Unfortunately, there is no hint at any problems from the SDK when loading a world.

I haven't had the time to try it myself, but we will file a bug report and have a closer look.

Best regards

Andreas

Hi Andreas,

With the new SDK there is no problem anymore. Tested on 5.1.4. Thanks a lot.

Bye,

Hieu
Login or Signup to post a comment