0
期間滾動在以下項目here is example廣東話.notifyDataSetChanged()
我使用的是.notifyDataSetChanged();
這種方法.post(new Runnable(){
增加新的項目
private void addItemsToList() {
int randomVal = MIN + (int) (Math.random() * ((MAX - MIN) + 1));
mItems.add(String.valueOf(randomVal));
mListAdapter.notifyDataSetChanged();
mCompleteListView.post(new Runnable(){
public void run() {
mCompleteListView.setSelection(mCompleteListView.getCount() - 1);
}});
}
public class ReceiverThread extends Thread {
String line;
String name;
ReceiverThread(String name, String line){
this.line=line;
this.name=name;
}
public void run() {
OpenStream.this.runOnUiThread(new Runnable() {
public void run() {
addItemsToList();}}}}
但時,我想通過滾動之後向下滾動使用手指,新的編程方式添加項目滾動列表視圖向下。
當我觸摸屏幕並使用手指進行滾動時,我該如何引發.post(new Runnable()
?或者我能做些什麼來不讓ListView向下滾動,當我觸摸屏幕?