I'm just getting started with the Honeycomb features, and after making
a simple (actionbar) tabbed test with fragments, I decided to convert
to the compatibility package.

So far so good, the only thing that does NOT seem to be working is the
(simple test) loader. See code below. The loader is actually executed,
and after 10 seconds "HENK" does appear on my screen, but there is no
"loading ..." visible. Does anybody know what the problem is ?

-- cut here (all comments stripped to keep it short) --

import android.content.Context;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.support.v4.app.LoaderManager;
import android.support.v4.content.Loader;

public class UserFragment extends TabContentFragment implements
LoaderManager.LoaderCallbacks<String> {
        private ArrayAdapter<String> mAdapter;

    public void onActivityCreated(Bundle savedState) {
        super.onActivityCreated(savedState);
        getLoaderManager().initLoader(0, null, this).startLoading();
    }

        public Loader<String> onCreateLoader(int id, Bundle args) {
                return new MyAsyncLoader(getActivity());
        }

        public void onLoadFinished(Loader<String> arg0, String arg1) {
        mAdapter = new ArrayAdapter<String>(getActivity(),
android.R.layout.simple_list_item_1, new String[] { arg1 });
        setListAdapter(mAdapter);
        }

        public void onLoaderReset(Loader<String> arg0) {
        }

        private static class MyAsyncLoader extends AsyncLoader<String> {

                public MyAsyncLoader(Context context) {
                        super(context);
                }

                public String loadInBackground() {
                        try {
                                Thread.sleep(10000);
                        } catch (Exception e) {
                        }
                        return "HENK!";
                }

        }
}

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to