im using Galaxy Tab 7.0 ....<br /> i have to use ScreenShot of Galaxy Tab 7.0...<br /> But!!!!<br /> When i click the Back Key and Power Key in Galaxy Tab, ExitDialog is appeared!<br /> so i can
t shot correct Screen!!
How do i disable Exitdialog???
you can override the onTouch method of the androidHarness in your MainActivity and do whatever you want in it
[java]
@Override
public void onTouch(String name, TouchEvent evt, float tpf) {
if (name.equals(ESCAPE_EVENT)) {
switch (evt.getType()) {
case KEY_UP:
this.runOnUiThread(new Runnable() {
@Override
public void run() {
AlertDialog dialog = new AlertDialog.Builder(AndroidHarness.this) // .setIcon(R.drawable.alert_dialog_icon)
.setTitle(exitDialogTitle).setPositiveButton("Yes", AndroidHarness.this).setNegativeButton("No", AndroidHarness.this).setMessage(exitDialogMessage).create();
dialog.show();
}
});
break;
default:
break;
}
}
}
[/java]
Oh! i can`t think that…^^
Thank you for your help!
@nehon
I have one question.
When i test this source code, Any other touchevent didn`t come in OnTouch Method except ‘BACK KEY’.
Other Touchevent is handled in SimpleApplication?
[java]
public class JMEActivity extends AndroidHarness
…
@Override
public void onTouch(String name, TouchEvent evt, float tpf) {
// TODO Auto-generated method stub
Log.i(“BACK”, "name = " + name);
}
[/java]
yeah only the KEYCODE_BACK is mapped to this callback…as opposed as the javadoc says
[java]
/**
- Gets called by the InputManager on all touch/drag/scale events
*/
[/java]
this is wrong
but really this callback only pops up the exit confirmation dialog, just exit the app without warning here and you won’t have the dialog