Catatan Seorang Prajurit Kecil

Ikon

biarlah semua itu berjalan sesuai "skenario" NYA – jika kau telusuri, semua logika itu akan kau temukan

How to Override ESCAPE button in BlackBerry Device


If we develop a BlackBerry Application, we always need to override ESCAPE character, this mean we want to add our script when user push ESCAPE button in their BlackBerry device. This is just a simple way how to override it.

  protected boolean keyChar(char arg0, int arg1, int arg2) {
    if((Characters.ESCAPE == arg0) && (!lblCurrentPath.getText().equals(FileExplorerLib.BASEPATH))){
      /* Locate your script here... */
      return true;
    }
    else
      return super.keyChar(arg0, arg1, arg2);
  }

You must locate that script in class that extend MainScreen.

 

 

Filed under: Algorithm and Programming,

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: