Questions tagged [android-strictmode]

This mode helps a developer to identify potential bugs in an app.

From Android Developer Docs:

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. By keeping your application's main thread responsive, you also prevent ANR dialogs from being shown to users.

135 questions
0
votes
1 answer

Android app extremely slow to swipe viewpager and scroll through recyclerview, how to pintpoint cause?

So, I've been stuck on this issue for a week where I launch my app and it freezes for almost 10 seconds on a white screen and after that the app gets really slow. I have a bottomnavigationview with a viewpager that loads four fragments, some of…
0
votes
1 answer

Why is StrictMode logging not being output on a Marshmallow device?

The code, called from Application.onCreate(): private fun enableOnStrictMode() { StrictMode.setThreadPolicy( StrictMode .ThreadPolicy .Builder() .detectAll() …
Ollie C
  • 28,313
  • 34
  • 134
  • 217
0
votes
2 answers

Where is the Android StrictMode implemented?

I'm looking to extend the StrictMode API, similar to what is suggested in this StackOverflow question. I saw that the API was extended in Honeycomb to include a detectCustomSlowMethod() API, which sounds like it could handle some extension cases…
Ryan Gross
  • 6,423
  • 2
  • 32
  • 44
0
votes
0 answers

Android StrictMode issue with Huawei Mate 9 Nougat

I've got an Android Instrumented test where I try to start my application and perform the following operations: open class MyApplication : Application() { ... override fun onCreate() { super.onCreate() initialiseLogging() …
0
votes
0 answers

Android Studio Strict Mode Unable to Locate Error

I am using the strict mode in android studio but i am unable to locate the code that's causing the error.The error is caused due to an unclosed object but i have checked all my activities and no such object has been left open. Error Log 02-10…
Jude Fernandes
  • 7,437
  • 11
  • 53
  • 90
0
votes
1 answer

Resource Leak issue in android

My android application is crashing with strictmode violation message with any specific information that what is causing the issue. Crash starting appearing when I configured FCM with my application and I am not performing network operations with FCM…
0
votes
1 answer

Can't find Closeable for StrictMode

I'm going through the test procedures from Android and while I was testing with StrictMode I got a warning about a resource leak at my camera, but I can't seem to find where. Here is the warning: A resource was acquired at attached stack trace but…
0
votes
0 answers

Android Strict mode policy for notification

I am using Strict mode in one of my main activity in onCreate method StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder() .detectAll() .penaltyLog() .penaltyDeath() …
Madhukar Hebbar
  • 3,113
  • 5
  • 41
  • 69
0
votes
0 answers

Android: Don't understand strict error message

I need help in understanding the following strict error message on my emulator which causes my app to stall (I am calling an activity) and the emulator to restart: 05-31 13:37:59.080 1298-1804/system_process E/SharedPreferencesImpl﹕ Couldn't…
AntonSack
  • 1,021
  • 2
  • 25
  • 47
0
votes
1 answer

Using StrictMode in app production phase

I know that StrictMode designed mainly to be used in application development phase, but according to my app needs, it's not acceptable to get ANR while it's quite acceptable to get crash, and StrictMode provides a way to prevent ANR…
Muhammed Refaat
  • 8,914
  • 14
  • 83
  • 118
0
votes
2 answers

Android Dev - Strict Mode Problems

I am having an issue with StrictMode i have the following AsyncTask class pruneDiskCacheTask extends AsyncTask{ @Override protected Void doInBackground(Void... params) { pruneRecursive(DiskCache); return…
Alex Mason
  • 21
  • 3
0
votes
1 answer

Application loading slow and how to use strict mode in android

I am facing lots of message through strict mode in logcat. May be this reason if i click next buttton on ui, then it takes long time almost 1 min. How to occure this, data loading process is fast. but why got strict mode log? i don't know. and…
user2340490
  • 137
  • 2
  • 14
0
votes
2 answers

StrictMode Policy in api 8 Android

I am displaying Image in Android App from Hosted Server. So, I need to set StrictMode Policy. But as I have checked, It requires Api 9 and I want to make it supportable in Api 8 also. So how can I solve this issue ? I am already using this in…
Jeeten Parmar
  • 5,568
  • 15
  • 62
  • 111
0
votes
3 answers

How to run this code in a Thread or Async Task?

When I tried running this code I get an error, about the strictMode Thread policy, so I added this line. StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); StrictMode.setThreadPolicy(policy); I later…
user1662302
0
votes
2 answers

Can't import android.os.StrictMode?

In my program, I can't import android.os.StrictMode even I change SDK version.What pronblem is it? In android.os, StrictMode can't be found. I don't know what to do.
Halo
  • 729
  • 1
  • 8
  • 18
1 2 3
8
9