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 8397009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:41:01+00:00 2026-06-09T20:41:01+00:00

I create an android App which works perfectly in Android 2.3+ all devices. But

  • 0

I create an android App which works perfectly in Android 2.3+ all devices. But when i tried to run in 2.2 but it crashed and gives error in log as,

08-16 10:22:41.323: E/dalvikvm(442): Could not find class       'android.os.StrictMode$ThreadPolicy$Builder', referenced from method com.uks.android.mssga.activity.LoginActivity.onCreate
08-16 10:22:41.333: W/dalvikvm(442): VFY: unable to resolve new-instance 39 (Landroid/os/StrictMode$ThreadPolicy$Builder;) in Lcom/uks/android/mssga/activity/LoginActivity;
08-16 10:22:41.333: D/dalvikvm(442): VFY: replacing opcode 0x22 at 0x000a
08-16 10:22:41.333: D/dalvikvm(442): VFY: dead code 0x000c-009a in Lcom/uks/android/mssga/activity/LoginActivity;.onCreate (Landroid/os/Bundle;)V
08-16 10:22:41.423: D/dalvikvm(442): GC_EXTERNAL_ALLOC freed 744 objects / 59064 bytes in 68ms
08-16 10:22:41.483: D/AndroidRuntime(442): Shutting down VM
08-16 10:22:41.483: W/dalvikvm(442): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
08-16 10:22:41.483: E/AndroidRuntime(442): FATAL EXCEPTION: main
08-16 10:22:41.483: E/AndroidRuntime(442): java.lang.NoClassDefFoundError: android.os.StrictMode$ThreadPolicy$Builder
08-16 10:22:41.483: E/AndroidRuntime(442):  at com.uks.android.mssga.activity.LoginActivity.onCreate(LoginActivity.java:58)
08-16 10:22:41.483: E/AndroidRuntime(442):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-16 10:22:41.483: E/AndroidRuntime(442):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
08-16 10:22:41.483: E/AndroidRuntime(442):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
08-16 10:22:41.483: E/AndroidRuntime(442):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
08-16 10:22:41.483: E/AndroidRuntime(442):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
08-16 10:22:41.483: E/AndroidRuntime(442):  at android.os.Handler.dispatchMessage(Handler.java:99)
08-16 10:22:41.483: E/AndroidRuntime(442):  at android.os.Looper.loop(Looper.java:123)
08-16 10:22:41.483: E/AndroidRuntime(442):  at android.app.ActivityThread.main(ActivityThread.java:4627)
08-16 10:22:41.483: E/AndroidRuntime(442):  at java.lang.reflect.Method.invokeNative(Native Method)
08-16 10:22:41.483: E/AndroidRuntime(442):  at java.lang.reflect.Method.invoke(Method.java:521)
08-16 10:22:41.483: E/AndroidRuntime(442):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
08-16 10:22:41.483: E/AndroidRuntime(442):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
08-16 10:22:41.483: E/AndroidRuntime(442):  at dalvik.system.NativeStart.main(Native Method)
08-16 10:22:44.503: I/Process(442): Sending signal. PID: 442 SIG: 9

Code of LoginActivity is,

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.login);

    StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder()
            .permitAll().build();
    StrictMode.setThreadPolicy(policy);

            // Other stuff
 }
  • 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-09T20:41:03+00:00Added an answer on June 9, 2026 at 8:41 pm

    StrictMode.ThreadPolicy.Builder was introduced in Android 2.3 (API level 9), so attempts to call it in versions earlier than that will fail.

    To stop it crashing on 2.2 and earlier you can choose to either:
    * Remove the ThreadPolicy code (as it is a developer debug tool to provide warnings of bad things you are doing)
    or
    * Use reflection to determine if the class exists before making use of it

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

Sidebar

Related Questions

I am trying to create an android app which will show multiple web urls
I want to create an Android app that can be used on 2.3.3 all
I'm trying to create a child class of Android.App.Application to override OnCreate(), but I
I have created an iPhone app which works perfectly smooth on my simulator. Now
I am planning to create a cross platform application which works in Android, iPhone
I am currently developing an android app where I create a notification Intent which
I created a standard Android app (ex. MyApp) which works fine. Now I would
I am trying to create an android app that has the following: Theme set
I am learning how to create an android app and webservice using: Eclipse IDE
To create facebook android native app we need to provide our Android application signature

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.