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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:56:30+00:00 2026-06-14T11:56:30+00:00

I wanted to learn twitter connect example. For that i just downloaded a sample

  • 0

I wanted to learn twitter connect example. For that i just downloaded a sample app from here. I just tried to run that app. When I run this app on Android 2.3.3, it is working fine but when I run it on android 4.1.2, it’s giving an error NetworkOnMainThreadException. In that code, the author has used AsynTask background thread to perform network operations but still this error exists. Now I am confused, where is the error coming from. Please help.

  • 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-14T11:56:32+00:00Added an answer on June 14, 2026 at 11:56 am

    There are two Solution of this Problem.

    1) Don’t write network call in Main UIThread, Use Async Task for that.

    2) Write below code into your MainActivity file after setContentView(R.layout.activity_main);

    if (android.os.Build.VERSION.SDK_INT > 9) {
        StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
        StrictMode.setThreadPolicy(policy);
    }
    

    And below import statement into your java file.

    import android.os.StrictMode;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wanted to learn this web app technology and develop cross platform apps for
I wanted to learn something about Spring and Maven, so I created sample Maven
I would like to learn ASP.NET and just wanted some input as to which
I'm new to castle windsor and wanted to learn it. I downloaded Windsor 2.5.3
If someone knew little about databases and wanted to learn about them from scratch,
I wanted to learn a little about multi threading in .NET and grabbed this
I wanted to learn this concept as per course syllabus. I need some idea
Just wanted to learn Cassandra and trying to convert RDBMS design to Canssandra. Considered
I wanted to learn Java, as recommended by most of the people I downloaded
I wanted to learn .NET Microframework and found that there is (among others) Netduino

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.