android - IllegalStateException: in DatabaseHelper file -


following link contains gist file in getting exceptions. getting exceptions @ lines 29 , 66.

https://gist.github.com/shashwathkumar/e1b26e8d4f6956c2afd4

use try-catch in both places.

public void insertcontact(contacts c){     try{        db = this.getwritabledatabase();        contentvalues values = new contentvalues();         string query = "select * contacts";        cursor cursor = db.rawquery(query, null);        int count = cursor.getcount();         values.put(column_id, count);        values.put(column_name, c.getname());        values.put(column_email, c.getemail());        values.put(column_password, c.getpassword());         db.insert(table_name, null, values);        db.close();     }catch(exception e){        system.err.println(e);     } } 

use try-catch other method also.


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -