我是这样创建ListView和listener的:publicListViewmainactivitylist;Viewview=this.getLayoutInflater().inflate(R.layout.activity_incomingagreement_list,null);mainactivitylist=view.findViewById(R.id.待审批合同列表);mainactivitylist.setOnItemClickListener(newAdapterView.OnItemClickListener(){@OverridepublicvoidonItemClick(AdapterView>parent,Viewview,intposition,longid){if(position==0){try{if("营销管理部".equals(GetUserPermission(loginusername))){Bundlebundle2=newBundle();bundle2.putString("loginusername",loginusername);Intentintent2=newIntent(MainActivity.this,NewAgreement.class);intent2.putExtras(bundle2);startActivity(intent2);}else{Toast.makeText(MainActivity.this,"当前用户没有发起合同的权限,只有营销管理部的用户才拥有此权限。",Toast.LENGTH_SHORT).show();}}catch(IOExceptione){e.printStackTrace();}}if(position==1){Intentincomingagreementlist=newIntent(MainActivity.this,IncomingAgreementList.class);startActivity(incomingagreementlist);}if(position==2){newThread(newRunnable(){@Overridepublicvoidrun(){Messagemessage=handleruserinfo.obtainMessage();handleruserinfo.sendMessage(message);}}).start();}}});- 发起新合同
- 待审批合同列表
- 当前用户信息
android:id="@+id/list" android:layout_width="match_parent"android:layout_height="match_parent"android:entries="@array/mainactivitylistview"/>进入程序后,列表内容显示是正常的,就是点击列表项没有任何反应,也没报任何异常,程序也没崩溃。我并没有在ListView里添加按钮或复选框什么的。请问怎么解决?
素胚勾勒不出你
相关分类