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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:26:27+00:00 2026-06-13T07:26:27+00:00

I use an SQLiteDatabase in my application which I created manually and then using

  • 0

I use an SQLiteDatabase in my application which I created manually and then using it in the android application. To navigate through it I am using a Cursor. I am showing the results from rows in edit texts.

When the orientation changes, irrespective of the row which was shown, the first row is shown in the edit Text. I know that android recreates the activity on orientation change and calls onCreate() method again.

But according to the documentation, I shouldn’t store a Cursor Object in onRetainNonConfigurationInstance() since it uses a Context.

Here is the code for creating Cursor.

DataBaseHelper myDbHelper = new DataBaseHelper(this);
Cursor c=myDbHelper.getDatabase().rawQuery("SELECT * FROM mytable",null);

Another recommended way is to handle the changes manually, but I do not want to do so since I want to take advantage of the default adjustment of UI.

How can I continue with the same row when the orientation changes ?

  • 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-13T07:26:28+00:00Added an answer on June 13, 2026 at 7:26 am

    One of the simplest way is to add this in your manifest file (for the concerned activity) –

    android:configChanges="orientation|screenSize|keyboardHidden"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing an android application which use SQLite database. The question is: can I
I have an application which requires the use of SQLite (Android's database). I have
In my Android app, I want to use my existing sqlite database.I followed http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/
I have an android application using an SQLite database. I open the database when
I'm developing an application. I need to use at least 400 audio files which
I am developing an application in which I have to use existing database but
I have an application which consists of two activities/screens and a java class from
I have an application of which i have use database to insert values on
I am building an application which has a database with two tables created internally
I am developing an android application which uses the SQLite database. In that case,

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.