在我的onCreate()
方法中,我有以下代码
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.menu_item_layout);
final TextView cumItemRating = (TextView) findViewById(R.id.CumItemRating);
final String postText = "(No rating)";
final Handler handler = new Handler();
Thread t = new Thread(){
public void run(){
handler.post(new Runnable(){
public void run(){
cumItemRating.setText(postText);
}
});
}
};
t.start();
addListenerOnRatingBar();
}
在该addListenerOnRatingBar()
方法上,我希望能够在cumItemRating.setText(postText)
每次运行此方法时更改并更新它。