0

I am used call the Async class .i am facing the one problem in logcat showing 07-22 12:31:42.657: I/Choreographer(29254): Skipped 31 frames! The application may be doing too much work on its main thread. this message after sometimes crass also .i didn't understand why this showing this message

my code is

 class LoadSubmitteddoinback extends AsyncTask<URL, Integer, Long>
     {
        MyProgressDialog dialog;JSONObject jobject=null;JSONArray jarraysubmit=null;
        String jsonresult="";
        int strat;
        public LoadSubmittedbloopsdoinback(int strat) {
            super();
            this.strat = strat;
        }

      protected void onPreExecute() 
      { 
          if(boolforprogressdialogmyfeed==true){

              dialog=MyProgressDialog.show(getActivity(), null,null);
              dialog.getWindow().setGravity(Gravity.CENTER); 
              footerView.setVisibility(View.GONE);
          }else{


          loading=true;
          footerView.setVisibility(View.VISIBLE);
//        listfortestmyfeed.addFooterView(footerView);
          }


      }
      @Override
      protected Long doInBackground(URL... arg0) {

    try {



       jsonresult= UrltoValue.getValuefromUrl(DataUrls.submittedsurl+"userid="+userid+"&category="+category+"&start="+strat+"&userid2="+quickuserid);
       Log.e("url is. submitted .load.", DataUrls.submittedsurl+"userid="+userid+"&category="+category+"&start="+strat+"&userid2="+quickuserid);
       jobject = new JSONObject(jsonresult);
          jarraysubmit = jobject.getJSONArray("urls");

          if(jarraysubmit.length()!=0){
                 for(int i=0;i<jarraysubmit.length();i++){

//                   JSONObject jobject= jarray.getJSONObject(i);
                     JSONObject jobject1= jarraysubmit.getJSONObject(i);
                      Bloop bloop= new Bloop();
                      bloop.setBloopid(jobject1.getString("id"));
                      bloop.setUserid(jobject1.getString("userid"));
                      bloop.setTitle(jobject1.getString("title"));
                      bloop.setDescription(jobject1.getString("description"));
                      bloop.setThumb(jobject1.getString("thumb"));

                      bloop.setKeywords(jobject1.getString("keywords"));

                      bloop.setAuthorPic(jobject1.getString("authorpic"));
                      bloop.setViewscount(jobject1.getString("Viewscount"));
                      bloop.setCommentscount(jobject1.getString("commentscount"));
                      try{
                          bloop.setUsercommentstatus(jobject1.getString("usercommentstatus"));
                          bloop.setPublicvalue(jobject1.getString("Public"));
                           bloop.setNsfw(jobject1.getString("NSFW"));}catch(Exception e){e.printStackTrace();}


                      bloops.add(bloop);

                     getActivity(). runOnUiThread(new Runnable() {
                             @Override
                             public void run() {

                                 myfeedAdapter.notifyDataSetChanged();
                                 Utility.setListViewHeightBasedOnChildren(listfortestmyfeed);
                            }
                        });



//                   
                 }

    }else{
        listfortestmyfeed.removeFooterView(footerView);
        listfortestmyfeed.setOnScrollListener(null);
    }

         loading=false;

  }  catch (Exception e1) {
            e1.printStackTrace();

       }


       return null;
      }

      @SuppressLint("NewApi")
      protected void onPostExecute(Long result) {
         try{

              if(boolforprogressdialogmyfeed==true){
                  dialog.dismiss();
                  boolforprogressdialogmyfeed=false;
              }


          }catch(Exception e){e.printStackTrace();}

          }

Above is my async class .i didn't findout mistake please guide me where mistake done.Advance thanks to all

Ashok
  • 637
  • 2
  • 11
  • 24
  • 2
    The problem isn't here, your async class is fine. If you're using too much time on the UI thread its elsewhere – Gabe Sechan Jul 22 '14 at 07:15
  • i write uithread seperately – Ashok Jul 22 '14 at 07:20
  • general information about this problem can be found [here](http://stackoverflow.com/questions/14678593/the-application-may-be-doing-too-much-work-on-its-main-thread) – User42 Aug 20 '15 at 10:56

0 Answers0