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 8137381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:05:57+00:00 2026-06-06T11:05:57+00:00

the Problem I am having is that the PostExecute is not firing. I see

  • 0

the Problem I am having is that the PostExecute is not firing.
I see the log tag for background but P.E. never fires.

I am invoking this task from a timer like this:

      findViewById(R.id.buttonstart).setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                try {
                    openFile("FeedTimerTask.html");
                    Timer t = new Timer("FeedTimerTask", true);
                    timerTask = new FeedTimerTask();
                    t.schedule(timerTask, 2000, 20000);
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
        });

Runnable runme = new Runnable() {

        @Override
        public void run() {
            timestart = Calendar.getInstance().getTimeInMillis(); 
            provider.refreshNoCache();


        }
    };

     class FeedTimerTask extends TimerTask{

        @Override
        public void run() {
            try{Looper.prepare();}catch(Exception e){};
            runme.run();

        }

     }

Here is the main task itself from inside the dataprovider class invoked with “provider.refreshNoCache();” above:

// threaded rteftesh tasks
@SuppressWarnings("rawtypes")
public class RefreshTask extends SupportAsyncTask {

    private int errorcodecode = 0;
    private ProgressDialog dialog=null;
    private Exception mainExeption=null;
    protected  String waitMessage = "Laddar ner information..";
    private boolean useCache;

    public RefreshTask(boolean useCache) {
        this.useCache = useCache;
    }

    public void onPreExecute() {
        data = null;
        if (showSpinnerOnRefresh){
            dialog = ProgressDialog.show(context, "", waitMessage , true);
            dialog.show();
        }
    }

    protected Object doInBackground(Object... params) {
        errorcodecode = 1;
            try {
                invokeFeedRead();
                Log.e("DataProvider", "Bkgtask...");
                errorcodecode = 0;
            } catch (BrJSONException e) {
                Log.e("[ERROR]","PROVIDER "+e.getMessage());
                mainExeption = e;
                errorcodecode = 1;
            } catch (IOException e) {
                Log.e("[ERROR]","PROVIDER "+e.getMessage());
                mainExeption = e;
                errorcodecode = 2;
            } catch (Exception e) {
                Log.e("[ERROR]","PROVIDER "+e.getMessage());
                mainExeption = e;
                errorcodecode = 3;
            }

        if (errorcodecode==0){ 
        }
        return null;
    }

    @Override
    protected void onCancelled() {

        super.onCancelled();
        Log.e("DataProvider", "Cancelled...");

        if (dialog != null)
            try{dialog.dismiss();}catch(Exception e){}
        BrAlert.Show(context, "Obs", BrAppConfig.ServerError+" (timeout)", 0);
        onError_IO(new IOException("Timeout!"));
        errorcodecode=2;


    }

    @Override
    protected void onPostExecute(Object result) {
        // super.onPostExecute(result);
        Log.e("DataProvider", "PostExec...");

        if (dialog != null)
            try{dialog.dismiss();}catch(Exception e){}

        switch (errorcodecode) {
        case 0:
            onFeedLoaded();             
            cacheAge = System.currentTimeMillis();
            break;
        case 1:
            onError_DataFormat(mainExeption);
            break;
        case 2:
            onError_IO(mainExeption);
            break;
        default:
            onError_GeneralExeption(mainExeption);

        }


    }

}
  • 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-06T11:05:58+00:00Added an answer on June 6, 2026 at 11:05 am

    Your task is cancelled even before it reached onPostExecte method. If the task is cancelled before it reaches onPostExecute Method. It will not trigger onPostExecute but trigger onCancelled Method. Please provide enough time to finish the task.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am having problem that this following script generates Email address when page is
The problem I'm having is that a Vehicle object is not being deleted from
I am having that problem that opacity is not added to tfrhe selected divs.
my problem is that having this code: int size=4384; char buffer[size]; codifyDHCPmessage(buffer, message, size);
I am having problem that when i am trying to submit the form by
Hi The problem am having is that I have multiple TreeView control and each
HI Guys, Here I am having problem that How can I post an image
The problem I'm having is that the first URL works and the second one
The problem I'm having is that the first URL works and the second one
The problem I'm having is that I want to use STL's sort with a

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.