Log in or register to post comments

how to change function button

November 22, 2012 - 9:37pm #1

please help me change function buttoh Toggle Flash in QCAR ImageTargets to Exit or about
http://i50.tinypic.com/17353s_th.png

how to change function button

November 23, 2012 - 12:26am #2

Hi, the "Toggle Flash" button is added to the button menu in this function in ImageTargets.java:

public boolean onCreateOptionsMenu(Menu menu) {

 

super.onCreateOptionsMenu(menu);

 mDataSetMenuItem = menu.add("Switch to Tarmac dataset");

menu.add("Toggle flash");

menu.add("Trigger autofocus");

 ...

}

Then the triggering of the button is handled in this method (again in ImageTargets.java):

   public boolean onOptionsItemSelected(MenuItem item)

The relevant line of code is:

   else if (item.getTitle().equals("Toggle flash"))

That is where you can plug your custom code to either Exit or to show an About dialog.

 

 

 

 

 

 

Log in or register to post comments