Blackberry 黑莓应用程序终止

Blackberry 黑莓应用程序终止,blackberry,Blackberry,我犯了一个错误 申请没有响应;进程终止 当我使用列表字段时,Dats来自服务器。代码如下: listnew = new ListField() { /* * protected void drawFocus(Graphics graphics, boolean on) { } */ protected boolean trackwheelClick(int status, int time) {

我犯了一个错误

申请没有响应;进程终止

当我使用
列表字段时,Dats
来自服务器。代码如下:

listnew = new ListField() {

        /*
         * protected void drawFocus(Graphics graphics, boolean on) { }
         */



        protected boolean trackwheelClick(int status, int time) {

            listFieldIndex = listnew.getSelectedIndex();
            listnew.setFocus();
            System.out.println(listFieldIndex);
            if (listFieldIndex < 0) {
                listFieldIndex = 0;

            }
            try {
                UiApplication.getUiApplication().invokeLater(
                        new Runnable() {
                            public void run() {
                                /*ODProgDetailScreen.shows.removeAllElements();
                                System.out.println("Value is-----"
                                        + listFieldIndex);
                                // System.out.println("ID IS EQUAL TO:-"+
                                // progurl);
                                ODProgDetailScreen.progDetailURL = ((Program) programList2
                                        .elementAt(listFieldIndex)).getId();
                                ODProgDetailScreen.progTitle = ((Program) programList2
                                        .elementAt(listFieldIndex))
                                        .getTitle();
                                // ProgramDetails.shows.removeAllElements();
                                UiApplication.getUiApplication()
                                        .pushScreen(new ODProgDetailScreen());
                                UiApplication.getUiApplication().popScreen(
                                        getScreen());*/
                            }
                        });
            } catch (Exception e) {
            }
            return true;
        }

    };

    listnew.setRowHeight(40);

    // setEmptyString("Hooray, no tasks here!", DrawStyle.HCENTER);

    listnew.setCallback(this);

    rows = new Vector();

    for (int x = 0; x < mDCtaegory.size(); x++) {
        Hashtable hs = (Hashtable)mDCtaegory.elementAt(x);
        row = new TableRowManager();

        // SET THE PRIORITY BITMAP FIELD
        // if high priority, display p1 bitmap

        /*artistImgField = new URLBitmapField(Bitmap
                .getBitmapResource("res/images/bg.jpg"));*/
        HTTPManager engine = new HTTPManager();
          BitmapField bitmap= new BitmapField(engine.readImageFromURL((String) hs.get("img"), 40, 40));
          row.add(bitmap);

BitmapField bitmap1=new BitmapField(engine.readImageFromURL((String) hs.get("ratingimage"), 40, 40));
BitmapField bitmap2=new BitmapField(Bitmap.getBitmapResource("arrow.png"));
        //row.add(bitmap1);


        LabelField task = new LabelField(hs.get("title"), LabelField.USE_ALL_WIDTH);



        row.add(task);
        row.add(bitmap1);
        row.add(bitmap2);

        rows.addElement(row);
    }
    listnew.setSize(rows.size());
    gridbackManager=new VerticalFieldManager(VerticalFieldManager.NO_HORIZONTAL_SCROLL|VerticalFieldManager.VERTICAL_SCROLL){
          protected void paintBackground(Graphics graphics)
          {  

                    int c = graphics.getColor();
                    //graphics.setColor(Color.WHITESMOKE);
                    graphics.drawBitmap(0, 0, backbitmap.getWidth(), backbitmap.getHeight(),backbitmap,0,0);

                    //graphics.setColor(c);

            super.paintBackground(graphics);
          }
          protected void sublayout( int maxWidth, int maxHeight )
          {
              int width = backbitmap.getWidth();
              int height = backbitmap.getHeight();
              super.sublayout( width, height);
              layoutChild(_vfm,width, height);
              setPositionChild(_vfm,0, 0);
              setExtent( width, height);
          }
        };
        mainlayout=new VerticalFieldManager(VerticalFieldManager.NO_HORIZONTAL_SCROLL|VerticalFieldManager.VERTICAL_SCROLL){
              protected void paintBackground(Graphics graphics)
              {  

                        int c = graphics.getColor();
                        //graphics.setColor(Color.WHITESMOKE);
                        graphics.drawBitmap(0, 0, backbitmap.getWidth(), backbitmap.getHeight(),backbitmap,0,0);

                        //graphics.setColor(c);

                super.paintBackground(graphics);

              }
              protected void sublayout( int maxWidth, int maxHeight )
              {
                  int width = backbitmap.getWidth();
                  int height = backbitmap.getHeight();
                  super.sublayout( width, height);
                  layoutChild(backbittopfield,maxWidth, maxHeight);
                  setPositionChild(backbittopfield,15, 20);
                  layoutChild(gridbackManager,maxWidth, maxHeight);
                  setPositionChild(gridbackManager,15, 43);
                  layoutChild(backbitbottomfield,maxWidth, maxHeight);
                  setPositionChild(backbitbottomfield,15, 194);
                  setExtent(Display.getWidth(), Display.getHeight());
              }
            };
    _vfm = new VerticalFieldManager(Manager.VERTICAL_SCROLL
            | Field.USE_ALL_HEIGHT | Field.USE_ALL_WIDTH) {

        public void paint(Graphics g) {
            int[] X_PTS_MAIN = { 0, Display.getWidth(), Display.getWidth(),
                    0 };
            int[] Y_PTS_MAIN = { 0, 0, Display.getHeight(),
                    Display.getHeight() };
            int[] drawColors_MAIN = { Color.WHITESMOKE, Color.WHITESMOKE,
                    Color.WHITESMOKE, Color.WHITESMOKE };

            try {
                // Draw the gradients
                g.drawShadedFilledPath(X_PTS_MAIN, Y_PTS_MAIN, null,
                        drawColors_MAIN, null);

            } catch (IllegalArgumentException iae) {
                System.out.println("Bad arguments.");
            }

            g.setBackgroundColor(Color.WHITESMOKE);
            g.clear();
            // Call super to paint the graphics on the inherited window
            super.paint(g);

        }

        protected boolean navigationMovement(int dx, int dy, int status,
                int time) {
            this.invalidate();
            return super.navigationMovement(dx, dy, status, time);
        }

        protected void sublayout(int maxWidth, int maxHeight) {

            layoutChild(listnew, maxWidth, maxHeight);
            setPositionChild(listnew, 0, 0);

            setExtent( 292, 150);
        }

    };
    _vfm.add(listnew);
    mainlayout.setBackground(bg);
    mainlayout.add(backbittopfield);
    gridbackManager.add(_vfm);
    mainlayout.add(gridbackManager);
    mainlayout.add(backbitbottomfield);
    add(headerbitmapfield);
    add(mainlayout);
    // this.add(listnew);
    UiApplication.getUiApplication().invokeLater(new Runnable() {
        public void run() {
            listnew.invalidate();
        }
    }, 500, true);
listnew=newlistfield(){
/*
*受保护的void drawFocus(图形,布尔开启){}
*/
受保护的布尔trackwheelClick(整数状态,整数时间){
listFieldIndex=listnew.getSelectedIndex();
listnew.setFocus();
System.out.println(listFieldIndex);
如果(listFieldIndex<0){
listFieldIndex=0;
}
试一试{
UiApplication.getUiApplication().invokeLater(
新的Runnable(){
公开募捐{
/*ODProgDetailScreen.shows.removeAllElements();
System.out.println(“值为------”
+列表字段索引);
//System.out.println(“ID等于:-+
//progurl);
ODProgDetailScreen.progDetailURL=((程序)programList2
.elementAt(listFieldIndex)).getId();
ODProgDetailScreen.progTitle=((程序)programList2
.elementAt(列表字段索引))
.getTitle();
//ProgramDetails.shows.removeAllElements();
UiApplication.getUiApplication()
.pushScreen(新的ODProgDetailScreen());
UiApplication.getUiApplication().popScreen(
getScreen())*/
}
});
}捕获(例外e){
}
返回true;
}
};
listnew.setRowHeight(40);
//setEmptyString(“万岁,这里没有任务!”,DrawStyle.HCENTER);
setCallback(this);
行=新向量();
对于(int x=0;x