Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8862651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:46:44+00:00 2026-06-14T15:46:44+00:00

Everything was running fine. But after some testing through my app. It crashes and

  • 0

Everything was running fine. But after some testing through my app. It crashes and in my Logcat I see this “Content View Not Yet Created ” After some googling, I found out that I should put my listadapter into onActivityCreated. My codes are a bit different, I’m using a lazyadapter so I think I need some advise. Please help me.

public class AndroidFragment extends SherlockListFragment  implements        ActionBar.TabListener{

            static final String URL = "https://xml.xml";
            static final String KEY_SONG = "song";
            static final String KEY_ID = "id";
            static final String KEY_TITLE = "title";
            static final String KEY_CAT_ARTIST = "artistcat";
            static final String KEY_DURATION = "duration";
            static final String KEY_THUMB_URL = "thumb_url";
            static final String KEY_BIG_URL = "big_url";
            static final String KEY_CAT_URL = "cat_url";
            static final String KEY_DESC = "cat_desc";
            ArrayList<HashMap<String, String>> menuItems;
            ListAdapter adapter;
            Context appContext;

            @Override
            public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
                appContext = inflater.getContext().getApplicationContext();

                new loadListView().execute();   



            return super.onCreateView(inflater, container, savedInstanceState);
            }


            public class loadListView extends AsyncTask<Integer, String, String> {

            @Override
            protected void onPreExecute() {
                    super.onPreExecute();
            }

            @Override
            protected String doInBackground(Integer... args) {
                // updating UI from Background Thread
            menuItems = new ArrayList<HashMap<String, String>>();


            XMLParser parser = new XMLParser();
            String xml = parser.getXmlFromUrl(URL); // getting XML
            Document doc = parser.getDomElement(xml); // getting DOM element

            NodeList nl = doc.getElementsByTagName(KEY_SONG);
            // looping through all item nodes <item>
            for (int i = 0; i < nl.getLength(); i++) {
            // creating new HashMap
            HashMap<String, String> map = new HashMap<String, String>();
            Element e = (Element) nl.item(i);
            // adding each child node to HashMap key => value
            map.put(KEY_ID, parser.getValue(e, KEY_ID));
            map.put(KEY_TITLE, parser.getValue(e, KEY_TITLE));
            map.put(KEY_CAT_ARTIST, parser.getValue(e, KEY_CAT_ARTIST));
            map.put(KEY_DURATION, parser.getValue(e, KEY_DURATION));
            map.put(KEY_THUMB_URL, parser.getValue(e, KEY_THUMB_URL));
            map.put(KEY_BIG_URL, parser.getValue(e, KEY_BIG_URL));
            map.put(KEY_CAT_URL, parser.getValue(e, KEY_CAT_URL));
            map.put(KEY_DESC, parser.getValue(e, KEY_DESC));
            // adding HashList to ArrayList
            menuItems.add(map);
            }
            return null;
            }   


            @Override
            protected void onPostExecute(String args) {

            if (getActivity() != null) {
            adapter=new MainPageLazyAdapter(getActivity(), menuItems);
            setListAdapter(adapter);


            }

            }
            }


            @Override
            public void onTabSelected(Tab tab, FragmentTransaction ft) {
            ft.add(android.R.id.content, this);
            ft.attach(this);
            }

            @Override
            public void onTabUnselected(Tab tab, FragmentTransaction ft) {
            ft.detach(this);

            }

            @Override
            public void onTabReselected(Tab tab, FragmentTransaction ft) {
            }

        }

MY LOGCAT :

10-08 17:29:32.946: E/AndroidRuntime(6376): FATAL EXCEPTION: main
10-08 17:29:32.946: E/AndroidRuntime(6376): java.lang.IllegalStateException: Content view not yet created
10-08 17:29:32.946: E/AndroidRuntime(6376):     at android.support.v4.app.ListFragment.ensureList(ListFragment.java:328)
10-08 17:29:32.946: E/AndroidRuntime(6376):     at android.support.v4.app.ListFragment.getListView(ListFragment.java:222)
10-08 17:29:32.946: E/AndroidRuntime(6376):     at in.wptrafficanalyzer.actionbarsherlocknavtab.AndroidFragment$loadListView.onPostExecute(AndroidFragment.java:108)
10-08 17:29:32.946: E/AndroidRuntime(6376):     at in.wptrafficanalyzer.actionbarsherlocknavtab.AndroidFragment$loadListView.onPostExecute(AndroidFragment.java:1)
10-08 17:29:32.946: E/AndroidRuntime(6376):     at android.os.AsyncTask.finish(AsyncTask.java:602)
10-08 17:29:32.946: E/AndroidRuntime(6376):     at android.os.AsyncTask.access$600(AsyncTask.java:156)
10-08 17:29:32.946: E/AndroidRuntime(6376):     at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:615)
10-08 17:29:32.946: E/AndroidRuntime(6376):     at android.os.Handler.dispatchMessage(Handler.java:99)
10-08 17:29:32.946: E/AndroidRuntime(6376):     at android.os.Looper.loop(Looper.java:137)
10-08 17:29:32.946: E/AndroidRuntime(6376):     at android.app.ActivityThread.main(ActivityThread.java:4512)
10-08 17:29:32.946: E/AndroidRuntime(6376):     at java.lang.reflect.Method.invokeNative(Native Method)
10-08 17:29:32.946: E/AndroidRuntime(6376):     at java.lang.reflect.Method.invoke(Method.java:511)
10-08 17:29:32.946: E/AndroidRuntime(6376):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:982)
10-08 17:29:32.946: E/AndroidRuntime(6376):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:749)
10-08 17:29:32.946: E/AndroidRuntime(6376):     at dalvik.system.NativeStart.main(Native Method)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T15:46:46+00:00Added an answer on June 14, 2026 at 3:46 pm

    I think this should solve your problem.

     @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
       View view = inflater.inflate(R.layout.layout, null);
       return view  //You must return your view here
    }
    
    @Override
    public void onResume() {
      //onResume happens after onStart and onActivityCreate
      new loadListView().execute();
      super.onResume() ; 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just upgraded to snow leopard. Before, I had everything running fine, but now
I am running some java script with a couple html controls. Everything works fine.
So everything was running fine with my app on heroku. I installed the devise
I'm running fabric (Django deployment to apache) and everything seems to work fine until
I'm using prototype.js for my web app, and I have everything running on Chrome,
I am running into some slightly tricky issues with a legacy db. Everything seems
I've tried nearly everything I can think of, but I'm still running into issues
I'm having this problem because I originially made everything in the main NIB, but
After some efforts I finally get cobertura running correctly for my web application on
I've deployed, after some struggle, a web-app on a (remote) Tomcat 5.5 server (Turnkey

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.