java - ListView OnItemClickListener doesn't get fired -


i have set android project navigation drawer , i'm working fragments

and activity_main.xml contains following:

<android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".mainactivity">  <framelayout xmlns:android="http://schemas.android.com/apk/res/android"     android:id="@+id/fragment_container"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:focusable="false"/>  <fragment android:id="@+id/navigation_drawer"     android:layout_width="@dimen/navigation_drawer_width" android:layout_height="match_parent"     android:layout_gravity="start" android:name="com.waldispd.homecast.navigationdrawerfragment"     tools:layout="@layout/fragment_navigation_drawer" />  </android.support.v4.widget.drawerlayout> 

fragment change:

staffelfragment newfragment = new staffelfragment(); newfragment.setarguments(getintent().getextras()); getfragmentmanager().begintransaction().add(r.id.fragment_container, newfragment).commit(); 

fragment_staffel.xml

<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:descendantfocusability="blocksdescendants"> <listview     android:id="@+id/staffellist"     android:layout_alignparentleft="true"     android:layout_marginleft="0dp"     android:layout_alignparenttop="true"     android:layout_margintop="0dp"     android:layout_width="match_parent"     android:layout_height="match_parent"></listview> </linearlayout> 

and problem is, when want receive item click listview item, doesn't fired. scrolling not possible on listview

item click listener :

listview staffellistview = (listview) findviewbyid(r.id.staffellist); staffellistview.setonitemclicklistener(new adapterview.onitemclicklistener() {      @override      public void onitemclick(adapterview<?> arg0, view arg1, int position, long arg3)      {          loadstaffel(position);      }  });  staffellistview.setadapter(new arrayadapter<string>(this, r.layout.drawer_listview_item, staffeltitel)); 

on other questions said add 'android:descendantfocusability="blocksdescendants" ' didn't solve problem. has idea?

instead of staffellistview.setonitemclicklistener use staffellistview.setonclicklistener


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -