0
@Override
public void onScroll(AbsListView view, int firstVisibleItem,
int visibleItemCount, int totalItemCount) {
// TODO Auto-generated method stub
Toast.makeText(ViewPage.this, "In" , 1).show();
if (loading)
{
if (totalItemCount > previousTotal)
{
loading = false;
previousTotal = totalItemCount;
currentPage++;
}
}
if (!loading && (totalItemCount - visibleItemCount) <= (firstVisibleItem + visibleThreshold))
{
for(int i=0;i<5;i++)
{
filename[i] = contactcursor.getString(contact_column_index);
Toast.makeText(ViewPage.this, filename[i] +" "+ contactcursor.getString(contact_column_index) , 1).show();
contactcursor.moveToNext();
}
arr_ad = new ArrayAdapter<String>(ViewPage.this, android.R.layout.simple_list_item_1, filename);
setListAdapter(arr_ad);
// I load the next page of gigs using a background task,
// but you can call any function here.
// new LoadGigsTask().execute(currentPage + 1);
loading = true;
Toast.makeText(ViewPage.this,totalItemCount+" "+visibleItemCount+" "+firstVisibleItem+" "+visibleThreshold+" ", 1).show();
}
}
這是代碼,其中當列表視圖中滾動下來onScroll應該只是工作的一部分,但它在作爲其內的吐司印刷活動開始自動工作工作。 thanx提前。onScroll無法正常