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
2
votes
1 answer

"findDOMNode is deprecated in StrictMode" using react-datepicker with React-Hook-Form

I'm having an issue when trying to use "showMonthDropdown" or "showYearDropdown" options with react-datepicker. Everything is working great until I click on the years or month Dropdown in the date picker, then I get this error in the console…
2
votes
1 answer

Is Google Play activating StrictMode for prelaunch tests?

I have submitted an app to Google Play and the Play Console prelaunch tests show a number of API policy violations (use of restricted / unsupported APIs): When I check the stack traces for these events I see that the API policy violation was…
Grodriguez
  • 21,501
  • 10
  • 63
  • 107
2
votes
0 answers

Нow to enable and see StrictMode on android in cordova

I modify via hook CordovaActivity.java. I insert the inclusion of a striсt mode there and then in the onTouchEvent I do an endless loop: package org.apache.cordova; . . . import android.os.StrictMode; public class CordovaActivity extends Activity…
Alex
  • 153
  • 8
2
votes
2 answers

A WebView method was called on thread 'FinalizerDaemon' BUT MY APP HAS NO WEBVIEW

I'm using StrictMode policy while developing my app: StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder() .detectLeakedSqlLiteObjects() .detectLeakedClosableObjects() .penaltyLog() …
Adam Varhegyi
  • 11,307
  • 33
  • 124
  • 222
2
votes
0 answers

Python(Server) Android(Client) Socket Programming

I'd like to make a program which connects Python code with Android Studio. But there has been a problem on android studio which is not showing any UI that I'd like to show on Emulator Screen. I think it is due to "StrictMode". But If I except the…
2
votes
3 answers

Ksoap2 is not working in android 3.0 getting NetworkOnMainThreadException

Ksoap2 is not working in Android 3.0. Logcat shows NetworkOnMainThreadException: 02-24 20:18:34.536: ERROR/AndroidRuntime(428): java.lang.RuntimeException: Unable to start activity ComponentInfo{com. Bill/com. Bill.Diag}:…
user632576
  • 31
  • 2
  • 4
2
votes
0 answers

StrictMode policy violation (DiskReadViolation) overestimates result against measureTimeMillis{} block

I have enabled StrictMode, and got a warning. StrictMode policy violation; ~duration=509 ms: android.os.strictmode.DiskReadViolation at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1453) at…
Artem Garkusha
  • 331
  • 5
  • 16
2
votes
2 answers

EditText caused Activity to leak. No current stackoverflow answer helped

I have a code with Android Strict Mode turned on, VmPolicy detectAll and Penalty Death. This is turned on in Application. So it helps me to detect memory leak. My code is very simple, 2 activities (almost blank). The MainActivity have a button click…
Elye
  • 53,639
  • 54
  • 212
  • 474
2
votes
1 answer

StrictMode violation when using a phone number in a TextView

There is a StrictModeDiskRead violation when creating a layout containing a TextView with a phone number using the parameter android:autoLink="phone". This is using com.android.support:appcompat-v7:22.2.0 Removing the autoLink parameter causes the…
JCraw
  • 404
  • 2
  • 12
2
votes
0 answers

Should a DatabaseObjectNotClosedException in StrictMode crash my app?

I don't see FATAL_EXCEPTION or anything like that anywhere. I thought these kind of exceptions were warnings, not errors. Should it crash my app? Note: the query was running on a worker thread. 05-18 10:33:05.446 E/StrictMode( 4102): Finalizing a…
Barry Fruitman
  • 12,316
  • 13
  • 72
  • 135
2
votes
0 answers

StrictModeViolation when calling AccountManager.getAccountsByType() from AsyncTask.doInBackground()

I'm calling AccountManager.getAccountsByType() in an AsyncTask.doInBackground() method. But it's causing this StrictModeViolation at least sometimes: android.os.StrictMode$StrictModeViolation: policy=95 violation=2 at…
murrayc
  • 2,103
  • 4
  • 17
  • 32
2
votes
1 answer

Android closing cursor in test with StrictMode enabled

So i'v added strict mode to project and now trying to fix all those things. But i can't figure out this one. I'm using ProviderTestCase2 So this is a test method which i trying to fix: public void testTaskInsertAndUpdateAndQuerySingleItem() { …
Kamil
  • 467
  • 2
  • 13
2
votes
1 answer

How to force log4j to write to a logfile not from main thread

On slow device got STRICT MODE exception: D/StrictMode: StrictMode policy violation; ~duration=494 ms: android.os.StrictMode$StrictModeDiskWriteViolation: policy=87 violation=1 at…
Nick Moskalenko
  • 941
  • 9
  • 10
2
votes
1 answer

how to know violation in strict mode

i am sending login request to web service and i have enabled strict mode and getting following error 03-05 16:54:36.490: E/AndroidRuntime(1106): FATAL EXCEPTION: main 03-05 16:54:36.490: E/AndroidRuntime(1106): …
Avinash Kumar Pankaj
  • 1,700
  • 2
  • 18
  • 27
2
votes
3 answers

Setting Bugsense handler on AsyncTask results in Strict Mode violation

I've setup Strict mode and then I've set up Bugsense handler. This resulted in StrictMode policy violation. Is there any logical explanation why it happens? How can I get rid of it? MyApplication.java: android.os.StrictMode.ThreadPolicy.Builder…
pixel
  • 24,905
  • 36
  • 149
  • 251
1 2 3
8 9