I have tried my best to remove the renderable but the renderable is not getting vanished after i click on the button. I had taken help of the stackoverflow similiar post but i was not able to delete the renderable even after applying the following code. I am using virtual device for testing.
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(anchorNode!=null){
arFragment.getArSceneView().getScene().removeChild(anchorNode);
anchorNode.getAnchor().detach();
anchorNode.setParent(null);
anchorNode = null;
Toast.makeText(MainActivity.this, "Test Delete - anchorNode removed", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(MainActivity.this, "Test Delete - markAnchorNode was null", Toast.LENGTH_SHORT).show();
}
}
});
Please tell me a solution for this
You have to remove the
Nodeon which you have used asetRenderable(), [In this case] Make sure you are rendering aRenderableon theanchorNodeobject.