Note that there are some explanatory texts on larger screens.

plurals
  1. POonListItemClick listener doesn't work
    text
    copied!<p>In my fragment i have a listview and when i click would open another activity that correspond at the item in the list.. But actually doesn't work and when i click nothing happen.</p> <pre><code>@SuppressLint("NewApi") protected void onListItemClick(ListView l, View v, int positionItem, long id) { Sensor sensor = sensorAdapter.getItem( positionItem ).getSensor(); String sensorName = sensor.getName(); Intent i = new Intent(getActivity(), SensorMonitor.class); startActivity(i); i.putExtra( "sensorname",sensorName ); startActivity( i ); } </code></pre> <p>Any help? the logCat say nothing if you want to ask me.. I can click but nothing happen.. I also added in the textview of listview:</p> <pre><code>android:focusableInTouchMode="false" android:clickable="false" android:focusable="false" </code></pre> <p>But nothing</p> <p>EDIT:</p> <p>This is the custom textview of the listview:</p> <pre><code>&lt;TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/text1" android:layout_width="match_parent" android:layout_height="fill_parent" android:layout_margin="10dp" android:fontFamily="sans-serif-light" android:gravity="center_vertical" android:padding="10dp" /&gt; </code></pre> <p>And this is the fragment xml in which there is the listview:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" &gt; &lt;!-- Included header.xml here --&gt; &lt;TableLayout android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingTop="@dimen/activity_vertical_margin" &gt; &lt;TextView android:id="@+id/titolodevicefragment" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:textColor="#DB3232" android:textSize="18dp" android:fontFamily="sans-serif-condensed" android:text="@string/titolosensorsfragment" /&gt; &lt;ListView android:id="@+id/listView1" android:layout_width="fill_parent" android:layout_height="wrap_content" /&gt; &lt;/TableLayout&gt; &lt;/LinearLayout&gt; </code></pre>
 

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