Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8346769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:07:30+00:00 2026-06-09T07:07:30+00:00

I do have an old app that refuses to work on Android 4.1 devices.

  • 0

I do have an old app that refuses to work on Android 4.1 devices. It’s the NetworkOnMainThreadException that jumps in here.

So I tried to permit this with the following steps – but these don’t work. I tested that with the 4.1 emulator. What is really needed to come around that error – app rewrite is no option. Currently I exclude 4.1 devices from my apps.

A class file …

public class StrictModeWrapper {

    static {
        try {
            Class.forName("android.os.StrictMode");
        } catch (Exception exception) {
            throw new RuntimeException(exception);
        }
    }

    public static void checkAvailable() {
    }

    @SuppressLint("NewApi")
    public static void setThreadPolicy() {
        StrictMode.ThreadPolicy strictModeThreadPolicy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
        StrictMode.setThreadPolicy(strictModeThreadPolicy);
    }
}

… called in an extended Application class:

public class MyApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();

        try {
            StrictModeWrapper.checkAvailable();
            StrictModeWrapper.setThreadPolicy();
            } catch (Throwable throwable) {
        }
    }
}

The extended Application class is registered in the Manifest and working.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T07:07:31+00:00Added an answer on June 9, 2026 at 7:07 am

    StrictMode behaves different on Android version >= 16 than prior releases. The docs suggest to issue StrictMode calls in onCreate() of an extended Application, Activity, etc.. At least onCreate() in an extended Application works different now and proofes the docs wrong (as of today).

    Here’s the StrictMode doc that describes how to add StrictMode calls to an extended application for example (that’s wrong as of today):

    StrictMode

    Here’s a Google Code issue that describes the problem and gives a workaround:

    Google Code Issue 35298

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an old iOS app that I never distributed and am now trying
At work I have an app sitting on Oracle 7.3 (old stuff, yes). Recently
I have an old app which did many UI initialization work in viewDidLoad of
We have an old java app wrapped as a service that essentially is a
Hi i have native ios app And i have old version that not compitible
I have a regular old iPhone app that has a main view controller that
I have an old Facebook app that installs on Facebook Pages. The tab page
I have an old post Re-Installing IPhone App From Inside The App That old
I have developed an Android App that contains a list of information. I want
I have an old vb6 app that I'm in charge of maintaining that saves,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.