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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:59:50+00:00 2026-06-06T05:59:50+00:00

I am now trying to create new database manager under Fragment class. But unfortunately,

  • 0

I am now trying to create new database manager under Fragment class. But unfortunately, I just stuck in the middle of some strage error that i never face with it before. Please have a look at below codes.

public class About extends Fragment {
DBManager gDatabase = new DBManager(this);
private AboutInfo ai;

The error code is that The constructor DBManage(About) is undefined.
Two quick fix available:

Change constructor ‘DBManager(Context) to ‘DBManager(About)”
Create constructor ‘DBManager(About)’

And here is my database manager codes.

public DBManager(Context context) {
    super(context, DB_NAME, null, 1);
    DBManager.myContext = context;
}

What is wrong with my codes? Any quick help would be appreciate.

  • 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-06T05:59:52+00:00Added an answer on June 6, 2026 at 5:59 am

    It needs an Activity context, not a Fragment context.

    Try:

    DBManager gDatabase = new DBManager(getActivity()); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm just trying to create a new MySQL database with a few simple tables.
Right now I'm trying to create my own tiny MVC (just for practice and
I've been trying now for some time to create a query that would count
So I'm trying to create a forum with avatars, but right now the text
I am trying to create two tables within the same sqlite database. Now, this
Hey. Nooby question but new with Entity. I am trying to create a new
Right now I am trying to create a producer/consumer thread, the producer thread goes
I'm trying to create a faster query, right now i have large databases. My
I've been trying to create a sprite sheet loader for days now, and I've
I am trying to create an api for a movie guide mobile application, now

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.