troubleshooting Question

Android Sqlite Update

Avatar of rmartes
rmartes asked on
JavaAndroid
8 Comments1 Solution1043 ViewsLast Modified:
Hey Experts,

I'm trying to do a simple update on a row from a database I've included in my assets folder. I am able to select rows, but can't seem to update. Here is my current code:

public void update(String table, int id) throws SQLiteException {
		myDataBase.beginTransaction();   
		try {  
			ContentValues args = new ContentValues();     
			args.put("visible", "Y");     
			myDataBase.update(table, args, "id=" + id, null);
			myDataBase.setTransactionSuccessful();   
		} finally {     
			myDataBase.endTransaction();   
		}
	}

The code executes without any errors, but when I use Sqlite explorer to view the record, no update has occurred. I am opening the database with OPEN_READWRITE.

Can someone plz help me out?

Thanks in advance.
ASKER CERTIFIED SOLUTION
simonet

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros