android - Can someone please explain this code snippet -
when try open web browser (from home in kindle fire hd) , plain fails launch. checked device logs , find below exception:
android.database.sqlite.sqliteexception: can't upgrade read-only database version 29 27
i googled exception , find following code snippet throwing exception. 1 please explain this. , need this
try { misinitializing = true; string path = mcontext.getdatabasepath(mname).getpath(); db = sqlitedatabase.opendatabase(path, mfactory, sqlitedatabase.open_readonly, merrorhandler); if (db.getversion() != mnewversion) { throw new sqliteexception("can't upgrade read-only database version " + db.getversion() + " " + mnewversion + ": " + path); }
private final int mnewversion;
public sqliteopenhelper(context context, string name, cursorfactory factory, int version, databaseerrorhandler errorhandler) { if (version < 1) throw new illegalargumentexception("version must >= 1, " + version); if (errorhandler == null) { throw new illegalargumentexception("databaseerrorhandler param value can't null."); }
mcontext = context; mname = name; mfactory = factory; mnewversion = version; merrorhandler = errorhandler; }
Comments
Post a Comment