Hi everybody!
I would like to display a button on the screen when a trackable is recognized. I'm working with the ImageTargets sample and followed the instructions given here https://ar.qualcomm.com/forums/showthread.php?t=32. The Toasts work perfectly.
My main.xml file was modified to look like this:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <Button android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="my text" android:onClick="myMethod" /> </FrameLayout>
I have added the method "myMethod" to ImageTargets.java that should be called when the button is clicked. It looks like this:
public void myMethod(View view) { // do the magic }
I'm not sure about where I should create the button. Doing that in the handleMessage method from the Toast example doesn't work.
I would appreciate any hints on how to solve this.
Thanks in advance!
Thanks Kim, I chose to use the Dominoes app for my purposes.
Everytime a new trackable is in the camera's focus I call from the Dominoes.cpp the method beneath.
The DominoesRenderer then sends a message to the GUIManager which sets the visibility of the buttons accordingly (for test purposes I only discriminate between the stones and the chips trackable).
Thanks for the advice, Kim.