我正在使用 FirebaseListAdapter,我需要显示一个 ProgressDialog,但我不知道如何知道它何时完成加载。
public class TabFragment1 extends ListFragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.tab_fragment_1, container, false);
ListView eventosView = (ListView) rootView.findViewById(android.R.id.list);
Firebase ref = new Firebase(//myappurl);
Firebase usersRef = new Firebase(//myappurl/eventos/users);
Singleton singletonUser = Singleton.getInstance();
setUser(singletonUser);
Firebase ref = new Firebase(//myappurl/eventos);
FirebaseListAdapter<Evento> mAdapter = new FirebaseListAdapter<Evento>(getActivity(), Evento.class, R.layout.event_row, ref) {
@Override
protected void populateView(View view, Evento evento) {
((TextView)view.findViewById(R.id.eventTitle)).setText(evento.getNome());
((TextView)view.findViewById(R.id.eventPlace)).setText(evento.getLocal());
}
};
setListAdapter(mAdapter);
return mAdapter;
return rootView;
}
private void setUser(Singleton singletonUser){
singletonUser.getToken();
singletonUser.setUuid();
singletonUser.getUuid();
}
}
什么时候可以放置 ProgressDialog.dismiss()?