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

  • Home
  • SEARCH
  • 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 6629895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:19:36+00:00 2026-05-25T22:19:36+00:00

I am developing an android app in which I am populating spinners from a

  • 0

I am developing an android app in which I am populating spinners from a SQLite database.
It has a simple form whose data is saved into a database table. I have kept an option to enable the user submit the form there itself.

So to get the id of the saved form i am moving the cursor to the last position. When I am trying to load the saved forms i am getting this error.

08-24 08:32:47.780: ERROR/AndroidRuntime(3988): FATAL EXCEPTION: main
08-24 08:32:47.780: ERROR/AndroidRuntime(3988): java.lang.IllegalStateException: couldn't move cursor to position 1
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at android.widget.CursorAdapter.getView(CursorAdapter.java:178)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at android.widget.Spinner.makeAndAddView(Spinner.java:192)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at android.widget.Spinner.layout(Spinner.java:151)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at android.widget.Spinner.onLayout(Spinner.java:115)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at android.view.View.layout(View.java:7192)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1254)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1243)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at android.widget.LinearLayout.onLayout(LinearLayout.java:1049)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at android.view.View.layout(View.java:7192)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1254)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1130)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at android.widget.LinearLayout.onLayout(LinearLayout.java:1047)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at android.view.View.layout(View.java:7192)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at android.widget.FrameLayout.onLayout(FrameLayout.java:338)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at android.widget.ScrollView.onLayout(ScrollView.java:1304)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at android.view.View.layout(View.java:7192)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1254)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1130)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at android.widget.LinearLayout.onLayout(LinearLayout.java:1047)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at android.view.View.layout(View.java:7192)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at android.widget.FrameLayout.onLayout(FrameLayout.java:338)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at android.view.View.layout(View.java:7192)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1254)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1130)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at android.widget.LinearLayout.onLayout(LinearLayout.java:1047) 
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at android.view.View.layout(View.java:7192)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at android.widget.FrameLayout.onLayout(FrameLayout.java:338)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at android.view.View.layout(View.java:7192)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1141)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1860)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at android.os.Handler.dispatchMessage(Handler.java:99)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at android.os.Looper.loop(Looper.java:123)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at android.app.ActivityThread.main(ActivityThread.java:3835)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at java.lang.reflect.Method.invokeNative(Native Method)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at java.lang.reflect.Method.invoke(Method.java:507)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
08-24 08:32:47.780: ERROR/AndroidRuntime(3988):     at dalvik.system.NativeStart.main(Native Method)

It is not pointing to any specific error in my files.
I removed move to last position and it is working. So I kept as soon as I am done with getting data from the cursor I am moving it back to first position. Still not working

All the forms below the first form are working rest of the forms are not working 🙁

Please kindly help me out

Yours Sincerely,
ChinniKrishna Kothapalli.

  • 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-25T22:19:36+00:00Added an answer on May 25, 2026 at 10:19 pm

    You can try this:

    if (cursor != null) 
    {
        try {
           while (cursor.moveToNext()) 
           {
            i = 0;
                // System.out.println(" =======> From DBConnect, Header => "+cursor.getString(1));
           }
        } catch (Exception e) {
           Log.d("DB_SELECT_BUSINESS_EXCEPTION", "" + e.getMessage());
        } finally {
           cursor.close();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an android app which fetches/uploads data from/to the web service every
I am developing an android app in which I have 3 spinners populated from
I'm currently developing an Android app, which loads events from a server using JSON
I am developing an Android app. It has a login page in which I
I am developing an android app which gives access to a form via a
I'm developing an Android app which needs to download a lot of data. To
I am developing an android app which has Facebook integration in it. I have
I am developing an android app (only Widget) which displays some images from a
I'm developing an Android app that fetches a web page from a website which
I am developing an android application in which i have to show data from

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.