I am trying to make an android browser, using SQLite databse to store history, bookmarks etc. It works fine when I insert Bookmarks but the app crashes when history is being entered. Also everything is working fine in android 7.0.
This is how I am trying to insert history in my database.
browser_data.execSQL("Insert into tb_history values('"+DateFormat.getDateTimeInstance().format(new Date())+"', '"+SqlCompatible(view.getTitle())+"' , '"+SqlCompatible(ac_sub)+"', '"+SqlCompatible(view.getUrl())+"');");
public static String SqlCompatible(String str){
str = str.replaceAll("'", "''");
return str;
}
Bookmarks and history table have just one difference which is the extra time and date column in history table.
Also I am pretty sure that table is being created correctly as I checked that, and also it's working in android 7.0, I also checked logcat but found nothing suspicious. I can post it if you guys want it.