Note that there are some explanatory texts on larger screens.

plurals
  1. POCombining dynamic edittext from listview with a string from database
    text
    copied!<p>I'm having trouble understanding how to do this function. My application shows a listview to the user with edittext that they will fill out. When they click my confirm button I need take their inputs and then on my next activity combining it with a string stored in my database. The string will contain dynamic text where I need to put the different edit texts in different spots. An example would look something like this....</p> <p>"This is part of my string where a " (edittext1) " would be in part of the end result. " (Edittext2) " and then more of the string here. etc etc. though I also want to be able to reference previous " (edittext1) " where I reuse them again. "</p> <p>I also want to make the edittexts a different color so they stand out from the rest of the text. I was looking into spannablestringbuilders but still having trouble understanding them, mostly how to do the setup above in a dynamic environment. Any explanations or sample code would really help me understand this.</p> <p>My database is build like this</p> <pre><code>Category_table _id Categorykey categorydesc 1 1 Music 2 0 Movies Source_table _id categorykey sourcedesc 1 1 Katy Perry 2 1 The Beatles 3 0 Lion King Title_table _id categorykey source key titlekey titledesc titlestory 1 1 0 1 Kissed A ""I kissed a(n) " edittext1 " and I " edittext2 " it. The taste of its "edittext3 " I Kissed a(n) " edittext1 " just to try it. I hope my "edittext4 " don't mind it. It felt so wrong. It felt so right. Don't mean I'm in love tonight. I kissed a(n) "edittext1 " and I " edittext2 " it. I "edittext2 " it." </code></pre> <p>//only putting one there since its so big on last column</p> <pre><code>Userword_table _id categorykey sourcekey titlekey userword 1 1 0 0 Past Tense Verb 1 1 0 0 Past Tense Verb 1 1 0 0 Noun 1 1 0 0 Noun </code></pre> <p>//a little more to this table but that would be for the above title_table </p> <p>So I'm using cursors with multi where statements to filter my 4 lvl listview. This next cursor being my current last cursor</p> <pre><code> public Cursor getUserWord() { return myDataBase.query(USER_WORD_TABLE, new String[] { KEY_ID, KEY_CATEGORY, KEY_SOURCE, KEY_TITLE, KEY_EDITWORD, KEY_USERWORD }, KEY_CATEGORY+ "=" + categories.categoryClick + " AND " + KEY_SOURCE+ "=" +source.sourceClick + " AND " + KEY_TITLE+ "=" + title.titleClick, null, null, null, KEY_ID); } </code></pre> <p>Let me know if you need more info</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload