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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:06:29+00:00 2026-05-27T13:06:29+00:00

12-07 11:25:34.290: E/AndroidRuntime(9177): FATAL EXCEPTION: AsyncTask #2 12-07 11:25:34.290: E/AndroidRuntime(9177): java.lang.RuntimeException: An error occured

  • 0
    12-07 11:25:34.290: E/AndroidRuntime(9177): FATAL EXCEPTION: AsyncTask #2
12-07 11:25:34.290: E/AndroidRuntime(9177): java.lang.RuntimeException: An error occured while executing doInBackground()
12-07 11:25:34.290: E/AndroidRuntime(9177):     at android.os.AsyncTask$3.done(AsyncTask.java:200)
12-07 11:25:34.290: E/AndroidRuntime(9177):     at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
12-07 11:25:34.290: E/AndroidRuntime(9177):     at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
12-07 11:25:34.290: E/AndroidRuntime(9177):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
12-07 11:25:34.290: E/AndroidRuntime(9177):     at java.util.concurrent.FutureTask.run(FutureTask.java:137)
12-07 11:25:34.290: E/AndroidRuntime(9177):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
12-07 11:25:34.290: E/AndroidRuntime(9177):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
12-07 11:25:34.290: E/AndroidRuntime(9177):     at java.lang.Thread.run(Thread.java:1096)
12-07 11:25:34.290: E/AndroidRuntime(9177): Caused by: java.lang.NullPointerException
12-07 11:25:34.290: E/AndroidRuntime(9177):     at com.UserLogin.Onaroundyou$getOnaroundyou.doInBackground(Onaroundyou.java:198)
12-07 11:25:34.290: E/AndroidRuntime(9177):     at com.UserLogin.Onaroundyou$getOnaroundyou.doInBackground(Onaroundyou.java:1)
12-07 11:25:34.290: E/AndroidRuntime(9177):     at android.os.AsyncTask$2.call(AsyncTask.java:185)
12-07 11:25:34.290: E/AndroidRuntime(9177):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
12-07 11:25:34.290: E/AndroidRuntime(9177):     ... 4 more

When I’m trying to insert json array into my sqlite database i’m getting this Nullpoint exception error.
on Lline 198
we are getting the value from jsonarray adding it to content values.

Till this line i’m getting values of json response i’ve printed key and value with in log. checked whether i’m getting any null values. But values are coming fine and i can able to see those in log. When my deguger entering into below line i’m gettng error. Please help once.

Evalues.put(InsertData.MyName,JSonArray1.getJSONObject(i).getString("MyName"));

Thanks in advance.

        private TextView tv;
        String str, Username, Eresult,Password;
        ProgressDialog dialog1;
        DatabaseHelper InsertEData;
        String attributeId ;
        Context mContext = this;
        SQLiteDatabase Edb ;
        JSONObject MyUserJsonObject;

    protected Void doInBackground(String... params) {
        // TODO Auto-generated method stub
                HttpClient httpclient = new DefaultHttpClient();
                // Dh.getWritableDatabase();

                String text1 = getString(R.string.site_name);
                String Url=text1+"Details";

                HttpPost httppost = new HttpPost(Url);


                try {
                HttpResponse responseGet = httpclient.execute(httppost);
                HttpEntity entity = responseGet.getEntity();
                if (entity != null) {
                    InputStream inputStreamResponse = entity.getContent();
                    Eresult = convertStreamToString(inputStreamResponse);
                    System.out.println(Eresult);
                    Edb= InsertEData.getWritableDatabase();

                    ContentValues Evalues = new ContentValues();
                    Evalues.clear();
                    MyUserJsonObject = new JSONObject(Eresult);

                    JSONObject menuObject = MyUserJsonObject.getJSONObject("UserDetails");
                    attributeId = menuObject.getString("login");

                    System.out.println("attribute  "+attributeId);
                    if (attributeId.equals("success")) {
                        JSONObject EObject = menuObject.getJSONObject("Ulist");
                        JSONArray EArray = EObject.getJSONArray("List");
                        System.out.println(EArray);
                        System.out.println(EArray.length());
                        for (int i = 0; i < EArray.length(); i++) {                             
                            //System.out.println(EArray.getJSONObject(0).getString("Name").toString());

                            Evalues.put(InsertEData.EName, EArray.getJSONObject(i).getString("MyName"));
                            Evalues.put(InsertEData.ELocation, EArray.getJSONObject(i).getString("Location"));
                            Evalues.put(InsertEData.ETotal, EArray.getJSONObject(i).getString("Total"));
                            Evalues.put(InsertEData.Eimage, EArray.getJSONObject(i).getString("Image"));
                            Edb.insert(InsertEData.ESLIST, null, Evalues );

                        }
                        Evalues.clear();

                        inputStreamResponse.close();

                    }else {
                        System.out.println("Unable to load page - " + responseGet.getStatusLine());
                    }
                }
                else
                    System.out.println("Entity Null");
            } catch (JSONException e) {
                // TODO Auto-generated catch block
                System.out.println("Network Error");
                e.printStackTrace();
            }
            catch (IOException e) {
                e.printStackTrace();
            }

            return null;}
  • 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-05-27T13:06:29+00:00Added an answer on May 27, 2026 at 1:06 pm

    “Can anyone know why this happening.”

    The short answer is: because some object is null where it shouldn’t be. Potential culprits could be InsertData, JSonArray1, or the result of JSonArray1.getJSONObject(i).

    Without more details it’s hard to pinpoint the exact cause. I suggest you breakpoint your code in order to find the issue.

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

Sidebar

Related Questions

Im getting this Error when loading an ESRI map inside the Android Environment. This
SELECT Dateipfad FROM Attribute WHERE FS = '290' AND Letztes_mal_bearbeitet <= '15.11.2011 11:06:58' The
I created a button programmatically: UIButton *myButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; myButton.frame = CGRectMake(290, 120,
I have a table in the following structure... ID USER_ID INTEREST 1 290 soccer
Here is my code to display the google map in my android emulator using
I'm getting on the very first call to my facelet a classnotfound exception. On
<table> <tr> <td> <img src=/me/images/register.jpg width=680 height=290> </td> </tr> </table> how can i show
I have int valA[3] = {290, 340, 390}; int valB[3] = {160, 200, 240};
In the book Java Persistence with Hibernate under the section titled Many Valued Associations
I have 2 listboxes in my app that use <Window.Resources> <ItemsPanelTemplate x:Key=WrapPanelTemplate> <WrapPanel Width=290/>

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.