Catatan Seorang Prajurit Kecil

Icon

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

Fill in your details below or click an icon to log in:

WordPress.com Logo

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

Twitter picture

You are commenting using your Twitter account. Log Out / Ubah )

Facebook photo

You are commenting using your Facebook account. Log Out / Ubah )

Connecting to %s

Ikuti

Get every new post delivered to your Inbox.