I have a database in which identifiers change after several lines, then I would change in some lines. What I want, the same values will be populated with a list in one line, then when the identifiers are the same, they are all on the same line. And thus, the following lines are filled with the same lines that have the same identifiers.
My database columns and rows are as follows:
Verse_id ------- words_id ---------- words_ar ------ translate_bn -
1
I want this database to be in three lines: (listview):
1. Mamun. Salam John Assistant. Operator. Assistant ------------------------------------------------------------------ 2. Smith. Roger. Manager. Director ------------------------------------------------------------------ 3. Qoel. Saki. Ali. Helper. Mechanics. Getman
I tried in two ways: First:
private static final String PRIMARY_ID = "_id"; private static final String TABLE_NAME = "bywords"; private static final String FRIEND_ID = "verse_id"; private static final String WORDS_ID = "words_id"; private static final String WORDS_bN = "translate_bn"; private static final String WORDS_AR = "words_ar"; private SQLiteDatabase database; private ArrayList<String> friends; private ArrayList<String> trans1; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main2); mContext = this; ExternalDbOpenHelper dbOpenHelper = new ExternalDbOpenHelper(this, DB_NAME); database = dbOpenHelper.openDataBase(); Cursor cursor = database.rawQuery("SELECT * FROM bywords", null); ListView list4=(ListView)findViewById(R.id.list4) ; String[] from = {WORDS_AR };
And the second:
trans1 = new ArrayList<String>(); String[] allColumns2 = new String[] { FRIEND_ID, BN_TRANS }; Cursor friendCursor2 = database.query(TABLE_NAME, allColumns2, null, null, null, null, null); if (friendCursor2 != null) { friendCursor2.moveToFirst(); }
In the second way, I can fill in two columns in two text representations on the same line. But what I want is that the corresponding lines with the same line identifier should be filled in one line of the list using verse I. The identifier is identical in lines, maybe 5, 10 or twenty lines of the same identifier. Whenever the same identifier they are one line, When Identification changes the beginning of a new line.