Note that there are some explanatory texts on larger screens.

plurals
  1. POExpandableListActivity make childItems unclickable
    primarykey
    data
    text
    <p>Hey I designed a help activity and I have kind of parents (groupItems) which have each one specific child.. So far there is no problem. But the childItems of the ExpandableListView are clickable by default so that they blink if you perform a click on them. And exactly that is what I want to avoid! This is the layout I use for the childs </p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"&gt; &lt;TextView android:id="@+id/grp_child" android:paddingLeft="20dp" android:textSize="15dp" android:textStyle="normal" android:layout_width="wrap_content" android:layout_height="wrap_content"/&gt; &lt;/LinearLayout&gt; </code></pre> <p>Here is my source code how all that gets filled with content (this works):</p> <pre><code>public class HelpActivity extends ExpandableListActivity { private static final String TAG = "HelpActivity"; private static final String PARENT = "parent"; private static final String CHILD = "child"; private List&lt;HashMap&lt;String,String&gt;&gt; parents; private List&lt;List&lt;HashMap&lt;String, String&gt;&gt;&gt; childs; public void onCreate(Bundle savedInstanceState) { Log.i(TAG, "Instantiated new " + this.getClass()); super.onCreate(savedInstanceState); setContentView(R.layout.help); parents = createParentList(); childs = createChildList(); SimpleExpandableListAdapter expListAdapter = new SimpleExpandableListAdapter( this, parents, // Describing data of group List R.layout.help_group_item, // Group item layout XML. new String[] {PARENT}, // the key of group item. new int[] {R.id.row_name}, // ID of each group item.-Data under the key goes into this TextView. childs, // childData describes second-level entries. R.layout.help_child_item, // Layout for sub-level entries(second level). new String[] {CHILD}, // Keys in childData maps to display. new int[] {R.id.grp_child} // Data under the keys above go into these TextViews. ); setListAdapter(expListAdapter); // setting the adapter in the list. } /* Creating the Hashmap for the row */ private List&lt;HashMap&lt;String,String&gt;&gt; createParentList() { ArrayList&lt;HashMap&lt;String,String&gt;&gt; result = new ArrayList&lt;HashMap&lt;String,String&gt;&gt;(); HashMap&lt;String,String&gt; m = new HashMap&lt;String,String&gt;(); m.put(PARENT,getResources().getString(R.string.help_parent_1)); result.add(m); m = new HashMap&lt;String,String&gt;(); m.put(PARENT,getResources().getString(R.string.help_parent_2)); result.add(m); m = new HashMap&lt;String,String&gt;(); m.put(PARENT,getResources().getString(R.string.help_parent_3)); result.add(m); return result; } /* creatin the HashMap for the children */ private List&lt;List&lt;HashMap&lt;String, String&gt;&gt;&gt; createChildList() { ArrayList&lt;List&lt;HashMap&lt;String, String&gt;&gt;&gt; result = new ArrayList&lt;List&lt;HashMap&lt;String, String&gt;&gt;&gt;(); for (int i=0;i&lt;parents.size();i++){ HashMap&lt;String, String&gt; sec = parents.get(i); ArrayList&lt;HashMap&lt;String, String&gt;&gt; secChild = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;(); HashMap&lt;String,String&gt; child = new HashMap&lt;String,String&gt;(); if(sec.containsValue(getResources().getString(R.string.help_parent_1))){ child.put(CHILD, getResources().getString(R.string.help_child_1)); }else if(sec.containsValue(getResources().getString(R.string.help_parent_2))){ child.put(CHILD, getResources().getString(R.string.help_child_2)); }else if(sec.containsValue(getResources().getString(R.string.help_parent_3))){ child.put(CHILD, getResources().getString(R.string.help_child_3)); }else if(sec.containsValue(getResources().getString(R.string.help_parent_4))){ child.put(CHILD, getResources().getString(R.string.help_child_4)); } secChild.add(child); result.add(secChild); } return result; } </code></pre> <p>}</p> <p>what I wanna to do is to make the textview the childs unclickable: I already tried the textview attributes but no one had an effect</p> <pre><code>android:clickable="false" android:focusable="false" android:enabled="false" </code></pre> <p>Thanks in advance to anybody who might have an idea!</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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