Multi-table database SQLite android

一曲冷凌霜 提交于 2019-12-03 21:51:38

You MUST use DIFFERENT TABLE NAMES!!

i.e.:

// Contacts Tables  names
private static final String TABLE_PRIMERO = "contacts_1";
private static final String TABLE_SEGUNDO = "contacts_2";
private static final String TABLE_TERCERO = "contacts_3";  
private static final String TABLE_CUARTO = "contacts_4";

Otherwise, you are always working on the same table (the only one you create), named "contacts"

Yogesh Lakhotia

All your table names are the same one

private static final String TABLE_PRIMERO = "contacts";
private static final String TABLE_SEGUNDO = "contacts";
private static final String TABLE_TERCERO = "contacts";  
private static final String TABLE_CUARTO = "contacts";

here you don't have multi-table you just one table named contacts

change table name

private static final String TABLE_PRIMERO = "contacts_primero";
private static final String TABLE_SEGUNDO = "contacts_segundo";
private static final String TABLE_TERCERO = "contacts_tercero";  
private static final String TABLE_CUARTO = "contacts_cuarto";
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!