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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:57:42+00:00 2026-06-04T02:57:42+00:00

Good day, Just to make it short with relevant code, If i do this

  • 0

Good day, Just to make it short with relevant code,

If i do this in my activity:

     Intent i = getIntent();
          Bundle extras = i.getExtras();

          BitmapFactory.Options bf = new BitmapFactory.Options();
          bf.inSampleSize = 2;


          filename = extras.getString("pic_name");
          ImageView  iv = new ImageView(getApplicationContext());
          Bitmap bm = BitmapFactory.decodeFile(filename, bf);
          iv.setImageBitmap(bm);
          setContentView(iv);

  registerForContextMenu(iv);



public boolean onContextItemSelected(MenuItem item){
       // weatherimagedb = new WeatherImageDB(this);
        //weatherimagedb.open();

        ContentValues vals = new ContentValues();
        int selection = item.getItemId();
        switch(selection){
        case Holidays:

             vals.put(ImageDB.HOLIDAYS, filename);

        break;
        case Weather:
            vals.put(ImageDB.WEATHER, filename);

        break;
        }
             imagedb.tagImage(filename, vals); //logcat error is here

  return true;
}

And in the imageDB database class i have a method like this:

public long tagImage(String pathname, ContentValues val){  
    return db.insert(DATABASE_TABLE, null, val);    //logcat error is here

}

i get this error in database, but it does not crash my app:

05-19 02:44:55.580: E/Database(3088): Error inserting 
05-19 02:44:55.580: E/Database(3088): android.database.sqlite.SQLiteException: near "null": syntax error: , while compiling: INSERT INTO imagetags(null)  VALUES(NULL);
05-19 02:44:55.580: E/Database(3088):   at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)
05-19 02:44:55.580: E/Database(3088):   at android.database.sqlite.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:92)
05-19 02:44:55.580: E/Database(3088):   at android.database.sqlite.SQLiteCompiledSql.<init>(SQLiteCompiledSql.java:65)
05-19 02:44:55.580: E/Database(3088):   at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:83)
05-19 02:44:55.580: E/Database(3088):   at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:41)
05-19 02:44:55.580: E/Database(3088):   at android.database.sqlite.SQLiteDatabase.compileStatement(SQLiteDatabase.java:1231)
05-19 02:44:55.580: E/Database(3088):   at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1658)
05-19 02:44:55.580: E/Database(3088):   at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1515)
05-19 02:44:55.580: E/Database(3088):   at com.MyApps.ImageUpdate.ImageDB.tagImage(ImageDB.java:82)
05-19 02:44:55.580: E/Database(3088):   at com.MyApps.ImageUpdate.ViewImage.onContextItemSelected(ViewImage.java:134)
05-19 02:44:55.580: E/Database(3088):   at android.app.Activity.onMenuItemSelected(Activity.java:2254)

what could i be doing wrong please?.. am i not using the ContentValues correctly enough?

Thank you.

  • 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-04T02:57:43+00:00Added an answer on June 4, 2026 at 2:57 am

    Could it be that your selection is neither Holidays nor Weather?

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

Sidebar

Related Questions

//Good day. This is just a part of my source code. My main predicament
Good Day All we are trying to do is inside a trigger make sure
Good day users, I want to make an form with an input field, and
Good Day. I'm using table-less forms and want to size the <label> block-element. This
Good day. I just want to consult about using websphere as san application server
Good day. I am just wondering how to create a base class and use
Good Day, I just started to learn HTML5 - have no issues, everything's going
This is just my second day at pygame, and I am not much aware
Good day. I have little usage of Flash CS4, however i have to build
Good day everyone, I am building a page in ASP.NET, and using Master Pages

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.