Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm not exactly a professional myself, but i'll give it my best shot. first it'd help if you had something to keep track of checkbox states in your expandablelistview. If you don't already have one. Here's what i use, which i adapted from <a href="https://stackoverflow.com/questions/5068668/android-expandablelistview-with-checkbox-controlling-checked-state">Android ExpandableListView with Checkbox, Controlling checked state</a>:</p> <pre><code>// set checkbox states ArrayList&lt;ArrayList&lt;Integer&gt;&gt; check_states = new ArrayList&lt;ArrayList&lt;Integer&gt;&gt;(children.length); public void setChildrenAndValues() { for(int i = 0; i &lt; children.length; i++) { ArrayList&lt;Integer&gt; tmp = new ArrayList&lt;Integer&gt;(children[i].length); for(int j = 0; j &lt; children[i].length; j++) { tmp.add(1); } check_states.add(tmp); } } </code></pre> <p>then in get childview:</p> <pre><code> childcb.setOnClickListener(new OnClickListener() { public void onClick(View v) { if (childcb.isChecked()) { check_states.get(groupPosition).set(childPosition, 1); }else{ check_states.get(groupPosition).set(childPosition, 0); } } }); </code></pre> <p>Thus following along the same vein, to save your content for your database, you might try this on some button's void onclick method:</p> <pre><code> if (check_states.get(groupPosition).get(childPosition) == 1) { desc_content4db.put(desc_tv.getText().toString(), content_et.getText().toString()); }else{ // placeholder code, w.e. you want } </code></pre> <p>and this else where: </p> <pre><code>HashMap&lt;String,String&gt; desc_content4db = new HashMap&lt;String, String&gt;(); </code></pre> <p>I have no idea if desc_tv/content_et.getText().toString() would work like you want it to. what's likely and seemingly more clumsy is that you might already need to have an ArrayList of Hashmaps of all the content ready - and then copy over all the stuff that you want to put in the database depending on if it corresponds to the checkbox at which ever position checked. It doesn't sound pretty but it might work.</p> <p>More ideal i would guess if you could step through the check_states list and depending on it it's 1 or 0, copy the edit_text and text_view at that id or position. sadly that's above my level right now. if you can do that, then more power to you.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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