Receive notification when the size of the drawable area of the touch screen changes

  1. Import the following classes:
    • javax.microedition.lcdui.Canvas
    • net.rim.device.api.ui.component.Dialog
  2. Extend javax.microedition.lcdui.Canvas.
  3. Override Canvas.sizeChanged(int, int).
    protected void sizeChanged(int w, int h) {
       Dialog.alert("The size of the Canvas has changed");
Next topic: Accelerometer

Was this information helpful? Send us your comments.