You can use a Handler to accomplish this task, like this:
In your activity add the Handler as any other property.
private Handler mListViewDidLoadHanlder = new Handler(new Handler.Callback() {
@Override
public boolean handleMessage(Message message) {
//Do whatever you need here the listview is loaded
return false;
}
});
And inside the getView method of your listview you do the comparison to see if the current position is the last one , so , it will finish (just put it before the return):
public View getView(int position, View convertView, ViewGroup parent) {
//Your views logic here
if (position == mObjects.size() - 1) {
mViewDidLoadHanlder.sendEmptyMessage(0);
}
return convertView;
}