protected void onExposed() {
   System.out.println("on Expose " + Engine.getInstance().docInfo.getLocalFilename());
   System.out.println(" file size  ");
   if (!Engine.getInstance().docInfo.getLocalFilename().equals("")
       && CrieUtils.getFileSize(Engine.getInstance().docInfo.getLocalFilename()) > 0) {
     Engine.getInstance().sendDocument();
   }
 }
 public void fieldChanged(Field field, int context) {
   //		Dialog.alert("test");
   if (!(field instanceof MyButtonField)) {
     super.fieldChanged(field, context);
     return;
   }
   MyButtonField btnField = (MyButtonField) field;
   if (btnField == nextBT) {
     //			Dialog.alert("next");
     currentIndex = currentIndex + Const.NUM_LIST;
     UiApplication.getUiApplication().pushScreen(WaitScreen.getInstance());
     Engine.getInstance().getDocument(currentIndex, search);
   } else if (btnField == previousBT) {
     //			Dialog.alert("prev");
     currentIndex = currentIndex - Const.NUM_LIST;
     UiApplication.getUiApplication().pushScreen(WaitScreen.getInstance());
     Engine.getInstance().getDocument(currentIndex, search);
   } else if (btnField == searchBT) {
     search = searchTextField.getText();
     UiApplication.getUiApplication().pushScreen(WaitScreen.getInstance());
     Engine.getInstance().getDocument(currentIndex, search);
   }
 }
  public void runMain() {

    Bitmap img = imgstock.getHeader();
    BitmapFieldWithStatus bf =
        new BitmapFieldWithStatus(img, BitmapField.FIELD_HCENTER | BitmapField.USE_ALL_WIDTH, "");
    add(bf);
    Engine.getInstance().registerStatus(bf);
    try {
      MainListVerticalFieldManager mainManager = new MainListVerticalFieldManager();
      XYEdges edge =
          new XYEdges(5, 25 * Display.getWidth() / 480, 2, 25 * Display.getWidth() / 480);
      HorizontalFieldManager mainHorizontalManager =
          new HorizontalFieldManager(
              HorizontalFieldManager.FIELD_HCENTER
                  | HorizontalFieldManager.USE_ALL_WIDTH
                  | HorizontalFieldManager.FIELD_VCENTER);
      RadioButtonGroup rgrp = new RadioButtonGroup();

      // EditField

      // EditField
      searchTextField =
          new EditFieldwithFocus(
              "Search: ",
              topic,
              35,
              BasicEditField.FIELD_HCENTER | BasicEditField.FIELD_VCENTER,
              MyColor.FONT_SEARCH,
              MyColor.SEARCH_COLOR) {
            public void layout(int width, int height) {
              super.layout(getPreferredWidth(), getPreferredHeight());
              setExtent(getPreferredWidth(), getPreferredHeight());
            }

            public int getPreferredHeight() {
              return 25;
            }

            public int getPreferredWidth() {
              return 340 * Display.getWidth() / 480;
            }
          };
      // edit.setBorder(BorderFactory.createSimpleBorder(edge,Border.STYLE_TRANSPARENT));
      // add(edit);
      MyButtonField button = new MyButtonField("Share a file", ButtonField.ELLIPSIS);
      // stopButton.setBorder(BorderFactory.createSimpleBorder(edge,Border.STYLE_TRANSPARENT));
      button.setChangeListener(new ButtonListener(rgrp, 12));
      button.setMargin(edge);
      mainManager.add(button);
      //			searchTextField.setMargin(edge);
      mainHorizontalManager.add(searchTextField);
      mainHorizontalManager.add(searchBT);
      mainHorizontalManager.setMargin(edge);
      mainManager.add(mainHorizontalManager);
      // BitmapField bff = new BitmapField(img,
      // BitmapField.NON_FOCUSABLE);
      // mainManager.add(bff);
      LabelField topicLabel =
          new LabelFieldWithFullBG(
              "Document Sharing",
              MyColor.FONT_TOPIC,
              MyColor.FONT_TOPIC_COLOR,
              MyColor.TOPIC_BG,
              Const.LABEL_WIDTH);
      edge = new XYEdges(2, 25 * Display.getWidth() / 480, 2, 25 * Display.getWidth() / 480);
      topicLabel.setMargin(edge);

      mainManager.add(topicLabel);
      _list = new TrainingListField();
      mainManager.add(_list);
      pagingManager.setMargin(edge);
      mainManager.add(pagingManager);
      add(mainManager);
    } catch (Exception e) {
      System.out.println("" + e.toString());
    }
    // bf = new BitmapField(img, Field.FIELD_BOTTOM | Field.USE_ALL_HEIGHT);
    // bf.setBorder(BorderFactory.createSimpleBorder(edge,Border.STYLE_TRANSPARENT));
    // add(bf);

    addMenuItem(_mainMenuItem);
  }