Android ExceptionInitializerError Can't Create handler inside thread that has not called Looper.prepare()
<p>I am making an app which parses online xml feed.I have used fragment and tabs.  </p>

<p>below is the code</p>

<pre><code>public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle       savedInstanceState) {
        // Inflate the layout for this fragment
         View v = inflater.inflate(R.layout.listview_file, container, false);
         allPress_listView = (ListView) v.findViewById(R.id.listView_for_all);
         progressBar=(ProgressBar)v.findViewById(R.id.progress_bar);

         return v;
       /* return inflater.inflate(R.layout.afragment, container, false);
        listView=(ListView)fi*/
    }  

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
       /* ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(getActivity(), android.R.layout.simple_list_item_1,Cheese );
        listView.setAdapter(adapter);*/
        progressBar.setVisibility(View.VISIBLE);

        new Thread(new Runnable() {  
           @Override
            public void run() {
            // TODO Auto-generated method stub
            try
              {
                   //Thread.sleep(5000);    
                   new DoSomeTask().execute();                           

              }catch(Exception e){}
                       // myPd_ring.dismiss();
          }
       }).start();

}
</code></pre>

<p>Problem is when I run the app on Samsung Galaxy Mini having android version 4.1.2, it run without crashing,but when I run the app on lower versions ,it crashes.Below is the error.</p>

<pre><code>05-30 16:34:43.139: E/AndroidRuntime(13631): FATAL EXCEPTION: Thread-164034
05-30 16:34:43.139: E/AndroidRuntime(13631): java.lang.ExceptionInInitializerError
05-30 16:34:43.139: E/AndroidRuntime(13631):    at com.sl.sx.APR$1.run(AllReleases.java:74)
05-30 16:34:43.139: E/AndroidRuntime(13631):    at java.lang.Thread.run(Thread.java:864)
05-30 16:34:43.139: E/AndroidRuntime(13631): Caused by: java.lang.RuntimeException:  Can't create handler inside thread that has not called Looper.prepare()
05-30 16:34:43.139: E/AndroidRuntime(13631):    at android.os.Handler.&lt;init&gt;(Handler.java:121)
05-30 16:34:43.139: E/AndroidRuntime(13631):    at android.os.AsyncTask$InternalHandler.&lt;init&gt;(AsyncTask.java:607)
05-30 16:34:43.139: E/AndroidRuntime(13631):    at android.os.AsyncTask$InternalHandler.&lt;init&gt;(AsyncTask.java:607)
05-30 16:34:43.139: E/AndroidRuntime(13631):    at android.os.AsyncTask.&lt;clinit&gt;(AsyncTask.java:190)
05-30 16:34:43.139: E/AndroidRuntime(13631):    ... 2 more
</code></pre>
