0

I have developed an application to click or select images from gallery and count the number of objects present in the image. For larger images, the processing is taking a while (10 to 15 seconds). The application looks like its frozen over this period. Here is the work flow of my application

Main Screen (blank screen with a button to move to next screen) -> Second screen (with a navigation drawer and a fragment). This fragment holds my ImageView. A button in the second screen my main drawer. The button is responsible for the start of processing. When ever the user clicks on this button, the processing starts and after a while the morphed image will be set to the image view and an alert dialog displaying the count will appear. So, in the onClick method, I will retrieve the image from image view and do the processing by calling some classes. After it is done I am setting the ImageView with the morphed Bitmap.

So, I would like make a call to the splash screen with text like "processing" after the image is retrieved and i want to hide this screen as soon as the bitmap is returned back from my other class. Then the morphed image is loaded to the image view. How do I do this?

Shravan DG
  • 527
  • 1
  • 5
  • 16
  • Possible duplicate of [How to create loading screen in android?](http://stackoverflow.com/questions/32439145/how-to-create-loading-screen-in-android) – takendarkk Apr 06 '17 at 19:54

1 Answers1

0

The application looks like its frozen over this period. Here is the work flow of my application

Any time consuming tasks should be executed in background (be it AsyncTask, IntentService or others). If needed. block the UI from user interaction, but do NOT make it blocked. UI thread must be responsive and 10-15 secs is a lot.

Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141