我想在網絡上加載圖片時在屏幕上顯示進度指示器。我用下面的代碼。,ProgressIndicator在黑莓手機上沒有動畫
Bitmap bitmap ;
BitmapField imageField ;
VerticalFieldManager vfm= new VerticalFieldManager();
ProgressAnimationField spinner =new ProgressAnimationField(Bitmap.getBitmapResource("spinner2.png"));
vfm.add(spinner);
new Thread(new Runnable()
{
public void run()
{
bitmap = new UrlToImage(Constants.ICON_URL+"_big.png"+suffix).getImage();
imageField = new BitmapField(bitmap);
vfm.delete(spinner)
vfm.add(imagefield);
}
}).start();
如果我執行,它會拋出illegalStateException。我再次變成ui thead,
Bitmap bitmap ;
BitmapField imageField ;
VerticalFieldManager vfm = new VerticalFieldManager();
ProgressAnimationField spinner =new ProgressAnimationField(Bitmap.getBitmapResource("spinner2.png"));
vfm.add(spinner);
UiApplication.getUiApplication().invokeLater(new Runnable()
{
public void run()
{
bitmap = new UrlToImage(Constants.ICON_URL+"_big.png"+suffix).getImage();
imageField = new BitmapField(bitmap);
vfm.delete(spinner)
vfm.add(imagefield);
}
});
沒有錯誤顯示。但progressanimationfield不是動畫的。 什麼改變我的代碼爲progressAnimatedField設置動畫效果。請給任何想法..
嗨。朋友..非常感謝你...它的工作... – RVG