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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:42:01+00:00 2026-06-05T18:42:01+00:00

My Activity creates an AsyncTask that loads data from a file and updates the

  • 0

My Activity creates an AsyncTask that loads data from a file and updates the UI on onProgressUpdate(), classic book AsyncTask.
But Android is putting the Activity onPause() right after the AsyncTask is launched.

I am trying to understand why (and how to prevent it)

This causes all AsyncTask UI updates to stop; then, when the AsyncTask finishes, the Activity does not resume by itself, I have to touch the screen or press some Action bar button to get it to onResume()

EDIT:
This is the logcat, (using aLogcat app to get it)

< To be updated with new complete log >

Temporary (first onPause() after file chooser):

06-12 22:08:48.744 11302 11302 D Viewer: + optionsItemSelected(itemID:2131296267)
06-12 22:08:48.754 11302 11302 D Viewer: + showFileChooser(path:/mnt/sdcard/Android/data/com.delphi.app/files, requestCode:0)
06-12 22:08:48.754 11302 11302 D Viewer: + onResume()
06-12 22:08:48.754 11302 11302 D Viewer: + onSaveInstanceState(outState:Bundle[{}])
06-12 22:08:48.754 11302 11302 D Viewer: + onPause()
06-12 22:08:48.754   189   443 I ActivityManager: START {act=android.intent.action.CHOOSER cmp=android/com.android.internal.app.ChooserActivity (has extras)} from pid 11302
06-12 22:08:48.764   189   489 D WindowManager: adjustConfigurationLw, config:{1.0 0mcc0mnc (no locale) layoutdir=0 sw800dp w800dp h1232dp xlrg port ?uimode ?night finger -keyb/v/h -nav/v} mLidOpen:-1 mHasDockFeature:true mHasHallSensorFeature:true config.hardKeyboardHidden:2
06-12 22:08:48.764 11302 11304 D dalvikvm: GC_CONCURRENT freed 244K, 5% free 6748K/7047K, paused 2ms+3ms

Temporary (second onPause() , the probelmatic one):

06-12 22:09:00.324 11302 11350 I LoaderTask: Publishing message 13
06-12 22:09:00.324 11302 11350 I LoaderTask: Adding message 14
06-12 22:09:00.324 11302 11350 I LoaderTask: Publishing message 14
06-12 22:09:00.354 11302 11350 I LoaderTask: Adding message 15
06-12 22:09:00.354 11302 11302 D MessageTable: + onLayout(changed:false, l:0, t:0, r:800, b:20)
06-12 22:09:00.354 11302 11350 I LoaderTask: Publishing message 15
06-12 22:09:00.364 11302 11302 D MessageTable: + getColumns()
06-12 22:09:00.364 11302 11302 D MessageTable: + getRowCount()
06-12 22:09:00.364 11302 11302 D MessageTable: + getRowAt(index:-1)
06-12 22:09:00.364 11302 11302 D MessageRow: + getColumns()
06-12 22:09:00.364 11302 11302 D MessageTable: + setHeaderColumns(cols:[I@41125668)
06-12 22:09:00.364 11302 11302 D MessageRow: + setColumns(cols:[I@41125668)
06-12 22:09:00.364 11302 11302 D Viewer: + onSaveInstanceState(outState:Bundle[{}])
06-12 22:09:00.364 11302 11302 D Viewer: + onPause()
06-12 22:09:00.364 11302 11302 D LoaderTask: + getState()
06-12 22:09:00.364 11302 11302 D LoaderTask: + pause()
06-12 22:09:00.364   189   489 D WindowManager: adjustConfigurationLw, config:{1.0 0mcc0mnc (no locale) layoutdir=0 sw800dp w800dp h1232dp xlrg port ?uimode ?night finger -keyb/v/h -nav/v} mLidOpen:-1 mHasDockFeature:true mHasHallSensorFeature:true config.hardKeyboardHidden:2

App structure, added upon request:

MainActivity
    Launch Viewer Activity on Button click

Viewer Activity
    Show layout, has a MessageTable (TableLayout)
    Launch ShowFileChosser  to choose a Records file
    Execute LoaderTask with given file

LoaderTask
    Open given file
    doInBackground()    
        Read one record
        Add the record to an ArrayList
        if not paused Publish record
    onProgressUpdate()
        Show record in MessageTable
  • 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-05T18:42:03+00:00Added an answer on June 5, 2026 at 6:42 pm
    06-12 18:21:09.394 9512 9512 D Viewer: + onStop()
    06-12 18:21:14.684 9512 9512 D Viewer: + onActivityResult(requestCode:0, resultCode:-1, data:Intent { dat=file:///mnt/sdcard/Download/Records.11111.MyLog.gzip })
    

    You’ve filtered the logcat so it’s hard to see all of what is happening, but it looks like you are using an Intent to get something (a filename?) from another activity during this 5 second gap.

    You should expect an onPause()-onResume() cycle anytime you transfer to another activity.

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

Sidebar

Related Questions

I have an Activity that retrieves data from a web service. This data is
I've created an AsyncTask that loads messaging history from a database and then shows
I've got an Android activity which grabs an RSS feed from a URL, and
I am trying to get my AsyncTask that parses xml and creates and arraylist
In my Activity I use a class which extends from AsyncTask and a parameter
I have an activity that starts with an AsyncTask to check the connection to
package com.markana.yamba; import winterwell.jtwitter.Twitter; import winterwell.jtwitter.TwitterException; import android.app.Activity; import android.graphics.Color; import android.os.AsyncTask; import android.os.Bundle;
I have some AsyncTask that loads a video stream into the player, so I
Some specific situation: I have two Activities . FirstActivity loads data from network(~100 kb)
I have a Service that creates AsyncTask s for downloading files. In activities, we

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.