0

If this question seems not specific enough or too specific, it's because I am trying this advance feature that I don't understand much about.

I want to be a great developer. So I set my phone to strict mode so I can test my app (my app works great when not in strict mode). In strict mode the app misbehaves in the following way, I am hoping someone can help me fix the problem:

PenActivity itself has a grid layout of images. When I click on an image, that image launches a FragmentDialog which itself has a grid layout of images. I am using Google's BitmapFun to handle the bitmaps (i.e. ImageFetcher). Anyway, from the FragmentDialog, when a user clicks an image, I start BookActivity with the path of the clicked image passed through an intent. Now here is the problem: say while in BookActivity, after doing some work, I click a button that calls finish() so that the app should return to PenActivity with the DialogFragment open. Well, when in strict mode, the app goes into a dark screen for a few seconds (2 or 3) before actually showing PenActivity with the DialogFragment open. BTW, the DialogFragment is fullscreen. Furthermore, if I click on another image in the DialogFragment, although it starts BookActivity, the wrong image is showing in BookActivity. I suspect that ImageFetcher is part of the problem.

So if you are not familiar with BitmapFun this may be a bit confusing. But remember, my question is about StrictMode versus normal Mode. My app works well in normal mode. I am trying to see if I can get it to work well in strict mode.

Katedral Pillon
  • 14,534
  • 25
  • 99
  • 199

1 Answers1

0

StrictMode is a developer tool which detects things you might be doing by accident and brings them to your attention so you can fix them.

StrictMode is most commonly used to catch accidental disk or network access on the application's main thread, where UI operations are received and animations take place. Keeping disk and network operations off the main thread makes for much smoother, more responsive applications.

Rakesh
  • 2,732
  • 29
  • 28