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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:24:55+00:00 2026-05-29T08:24:55+00:00

I have this SQLite containing a number of ‘Projects’. Each ‘Project’ with its attributes

  • 0

I have this SQLite containing a number of ‘Projects’. Each ‘Project’ with its attributes from the SQLite Database Table are displayed in an activity. What I wanna do is, when a button inside the activity is clicked, it updates the C_FAVORITE row of that ‘Project’.

How am I able to do so? Which arguments do I need to put inside the update method below?

public void makeFavorite() {
Database.Project.C_FAVORITE.update(.......);
}

this is how I display the attributes of the Project on the activity:

public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.project);

        loader = new ImageLoader(this);
            Intent intent = getIntent();
            if (intent != null) {
                Uri uri = intent.getData();
                if (uri != null) {
                    final Cursor cursor = managedQuery(uri, new String[] {
                            BaseColumns._ID, Database.Project.C_PROJECTTITLE, Database.Project.C_ORGANIZATIONTITLE,
                            Database.Project.C_PROJECTDESCRIPTION,Database.Project.C_BIGIMAGE,Database.Project.C_DONATIONAMOUNT,Database.Project.C_ADDRESS,Database.Project.C_WEBSITE,Database.Project.C_SHORTCODE,Database.Project.C_KEYWORD,Database.Project.C_PRICE,Database.Project.C_CAMPAIGNID,Database.Project.C_PAYPALEMAIL,Database.Project.C_ELVAVAILABLE}, null, null, null);

                    if (cursor == null) {
                        finish();
                    } else {
                        if (cursor.moveToFirst()) {
                            ImageView img = (ImageView) findViewById(R.id.project_image);
                            TextView project_title = (TextView)findViewById(R.id.txt_project_title);
                               project_title.setText(cursor.getString(1));

……

  • 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-29T08:24:56+00:00Added an answer on May 29, 2026 at 8:24 am

    You can try as follows:

    public SQLiteDatabase sqd;
    
    //Create connection of database
    
    public void makeFavorite(String fieldname,String c_fav_value) {
    ContentValues cv = new ContentValues();
    cv.put(fieldname,c_fav_value);
    int i= sqd.update(table_name, cv, where, where_clause);
    }
    

    If you have no where clause you can pass null there.

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

Sidebar

Related Questions

I have an sqlite database on android created like this: sqlite> .schema CREATE TABLE
I have implemented a custom SQLite database helper. I have a table containing sms
I have a SQLite database with a table containing the scores of some league
]i have this graph that shows the last 7 records from my sqlite database,
I have a sqlite (v3) table with this column definition: timestamp DATETIME DEFAULT CURRENT_TIMESTAMP
I have a database file that is generated on a PC using Sqlite. This
I have a datalogging application (c#/.net) that logs data to a SQLite database. This
I'm using an sqlite database in my app. I have this dbhelper class in
I have this weird problem. I have defined a column in a SQLite database
I have this code to create a database: from sqlalchemy import create_engine from sqlalchemy

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.