リスナー内のテキストビュー、プログレスバー、およびボタンの UI を更新しようとしています。以下は私のコードです:
GetDownloadListener listener=new GetDownloadListener() {
@Override
public void onDownloaded(String path, int pos) {
//updating db
System.out.println("On downloaded"+contentCosts.get(pos).getRecoContentName());
updateDatabase(pos,path);
mainProgress.setIndeterminate(false);
mainProgress.setMax(contentCosts.size());
textViewContent.setText("Downloaded "+contentCosts.get(pos).getRecoContentName());// This textview does not get updated
downloadedList.add(contentCosts.get(pos));
downloadCount++;
mainProgress.setProgress(downloadCount);
if(downloadCount<contentCosts.size()){
callDownload(downloadCount);
}else{
DownloadingScreen.enableLaunchButton();
}
}
};
プログレスバーとボタンはリスナー内のコードに基づいて更新されますが、行textViewContent.setText("Downloaded "+contentCosts.get(pos).getRecoContentName());
はテキストビューを更新しません。他のUIコンポーネントが同じリスナーから更新されるのに、このテキストビューだけが更新されない理由は何ですか。
どんな助けでも大歓迎です。