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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:02:14+00:00 2026-06-03T06:02:14+00:00

I have created three activities. one is DBActivity which is used to performing the

  • 0

I have created three activities.
one is DBActivity which is used to performing the database oriented operation(creating, inserting, retreiving, droping closing etc.).
The createing the database is executing in the constructor of the DBActivity.
The seconding activity StoreActivity will store the EditText values to the database.
The third activity RetrieveActivity will retreive the database values.
I have created the object for the DBActivity and saved the values in to the database.
While retreiving the database in the RetreiveActivity, What is the idea to get the database..?
If I created the object for the DBActivity a new database will created, it led me to the trouble.
How can I access the same database created in the StoreActivity…Can you help me with codings..?
Thanks in advance….

  • 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-03T06:02:16+00:00Added an answer on June 3, 2026 at 6:02 am

    Your Question reflects the problem in your concept. You want to access the database independent from all your activities. So you should not put your database logic in a class of type Activity. Write your own database helper class by subclassing from this one: SQLiteOpenHelper.
    Now you can create an instance of that database helper class in every Activity you want to access your database. And you can maybe think about to try a Singleton instance. So you always retrieve the same helper instance.

    Edit: The key for retrieving always the same database is, to always use the same database name in the constructor of the SQLiteOpenHelper class.

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

Sidebar

Related Questions

i am new to iPad developer, i have created two or three iPad application
I have created a UserForm where the user is required to fill-in three fields.
I have a convenience class for encoding URI's. In it I've created three methods
I have created custom cell in which there are n number of image views.
I have created a view in which there is a capture button. When i
I have one problem... There is a table in my MySQL database that stores
I have 4 Different Activities, and going through the links I have created a
I have three activities: Activity A - Displays a list of data from a
So, I have three activities/screens. On the first screen, there's a button, that when
I have two activities. One activity has the main game and the other activity

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.