1

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() はいつ配置できますか?

4

2 に答える 2

3

2017 年 1 月以降FirebaseListAdapter、オーバーライド可能な次のメソッドがあります (Frank が github にコミット):

  /**
     * This method will be triggered each time updates from the database have been completely processed.
     * So the first time this method is called, the initial data has been loaded - including the case
     * when no data at all is available. Each next time the method is called, a complete update (potentially
     * consisting of updates to multiple child items) has been completed.
     * <p>
     * You would typically override this method to hide a loading indicator (after the initial load) or
     * to complete a batch update to a UI element.
     */
    protected void onDataChanged() {
    }
于 2017-02-16T11:35:45.873 に答える