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
1
vote
1 answer

red frame like stripes in android screen

we are developing an android device. its on android 4.4.2. My issue is that i am getting red frame like strip which occur at different frequencies. some come and go very fast. but some stay for some time. i tried to remove the strict mode in…
JVN
  • 239
  • 2
  • 16
1
vote
3 answers

Trying to get text from the text file located on sever

I am trying to get strings from the text file from server and show it on ListView. I am calling getTextListFromUrl() from pull to refresh, by overriding the method onRefersh(). But I am stuck somewhere. Here is my code public class ScreenTwoActivity…
Vid
  • 1,012
  • 1
  • 14
  • 29
1
vote
1 answer

Jsoup - Close not called - Android StrictMode

I use Jsoup to parse a file from a remote URL like the following: Document doc = Jsoup.connect(urlString) .timeout(5000) .get(); If the website fails to respond within the timeout, a SocketTimeoutException is thrown, as expected. I also…
1
vote
1 answer

Red color border flashes on clicking Send button

I'm making a chat application, where user types and when he hits enter button. When I press Enter button, I'm getting red color flash around the entire screen and it disappears . How to handle this?? NOTE: Strict Mode is Disabled in Developer…
DroidLearner
  • 2,115
  • 5
  • 31
  • 50
1
vote
2 answers

Android StrictMode always complains about FileReader

When StrictMode is enabled, it always complains that FileReader has DiskReadViolation. No matter how I improved, it's still there. I suspect that it has something to do with UIThread lagging problem, please let me know how to fix it, thx. 06-03…
thecr0w
  • 2,148
  • 4
  • 33
  • 59
1
vote
1 answer

Instance count violation in an Android Java app

I am working on an Android application. In abstract, this application has an UI in order to interact with user and it also interacts with a remote service. The remote service adds a notification to Android launcher bar and this notification allows…
1
vote
2 answers

Attempting to follow basic How to connect Android with PHP, MySQL tutorial: application crashes - cannot import android.os.StrictMode

Ok - so I'm using the following tutorial: "How to connect Android with PHP, MySQL" However almost everyone who attempts the tutorial (judging from the comments) is having force close issues due to the application only being designed to run on API…
1
vote
1 answer

ImageView setImageURI is causing strictmode error onPause

Every time I finish an application that contains a GridView with an ArrayAdapter in which I return an ImageView from getView() I get an error that says: 01-15 17:28:55.715: E/StrictMode(6480): A resource was acquired at attached stack trace but…
1
vote
1 answer

Resource leak in http call execution

I am receiving the below error message when I execute this code. A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.: I am unable to identify the resource leak in the…
muneikh
  • 2,067
  • 5
  • 25
  • 59
0
votes
0 answers

Android Presentation causes StrictModeViolation for Nonvisual Context despite having activity context

since I got the first device with Android 11 (it's POS hardware, i.e. cash registers; manufacturers are slow to upgrade android versions - nothing to discuss here and now ;-) I keep getting tons of messages like E/ViewConfiguration: Tried to access…
cheesus
  • 47
  • 1
  • 6
0
votes
0 answers

StrictMode policy violation Android in Gson

I am getting the following in my application: StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Lsun/misc/Unsafe;->theUnsafe:Lsun/misc/Unsafe; at android.os.StrictMode.lambda$static$1(StrictMode.java:428) at…
theblitz
  • 6,683
  • 16
  • 60
  • 114
0
votes
1 answer

How can I find where the nonSdk violation is occuring in my source code?

I created an app that works perfectly fine on my phone but not well on an MI phone. The reason must be using non-SDK APIs. I have a Pre-launch report which tells me I am using non-SDK API's but I am unable to understand where it is occurring.…
0
votes
1 answer

App is crashing Caused by: java.lang.IllegalStateException: No successful match so far

My app is running perfectly at debug mode but is crashing at release mode, so when i set debuggable to be true i realized that the error is from switch case and one method. Caused by: java.lang.IllegalStateException: No successful match so far at…
0
votes
2 answers

How to fix "System services not available to Activities before onCreate" when passing values between classes, and updating recycler view?

I'm making an order taking cashier application. Using a recycler view to show the order queue. However, I'm having trouble passing ArrayList values between classes, and also, updating the recycler view. In this case, I won't have a massive recycler…
StyleOver
  • 73
  • 9
0
votes
1 answer

I am getting warnings in my android program after I updated my project to android x library in android studio

Below are the warnings I am getting. 1) Android compatibility - Google play store has marked API ' Lcom/android/org/conscrypt/OpenSSLSocketImpl;->setAlpnProtocols()' grey listed and they cant guarantee that this API will work on existing…
Muthukumaaran
  • 17
  • 1
  • 9
1 2 3
8 9