资源描述:
《android listview _____在点击listview的item时背景变色 点击释放时背景变为无色且跳转别的activity(listview _____在点击listview的项目时背景变色点击释放时背景变为无色且跳转别的活动)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、AndroidListView_____在点击ListView的Item时背景变色点击释放时背景变为无色且跳转别的Activity(ListView_____在点击ListView的项目时背景变色点击释放时背景变为无色且跳转别的活动)AndroidListView.Clickonthebackgroundcolorrelease...ClicktheListViewItemwhenthebackgroundiscolorlessandjumpanotherActivity._BaiduknowBaid
2、uhomepage
3、Baiduknow
4、
5、loginregistrationPostBarnewspageMP3photovideoencyclopedialibraryhelp
6、setBaiduknows>Computer/Network>programming>JAVArelatedAndroidListView...WhenclickedonListView'sItem,thebackgroundcolorischanged.Whenclicked,thebackgroundbecomescol
7、orlessandjumpstoanotherActivity.Questioner:2011-7-2517:17newnife
8、rewardpoints:40
9、Views:6262011-7-2518:17,thebestanswerislv.setOnTouchListener(NewOnTouchListener(){@OverridePublic,Boolean,onTouch(View,V,MotionEvent,event){Auto-generatedmethodstub//TODO(i
10、f)(event.getAction==MotionEvent.ACTION_DOWN){Lv.setBackgroundColor(Color.BLUE);}Elseif(event.getAction)(==MotionEvent.ACTION_UP){Lv.setBackgroundColor(Color.BLACK);Intent,intent,=new,Intent(Activity1.this,Activity2.class);StartActivity(intent);}Returnfa
11、lse;}})questioninggrace.So,whatdoIwanttodowithpostion'sitemforListView?Also,ItriedtheLVplustouchevent.No,touchisthewholelv..NotLv'sitem.Justanswerthis,butdouble-clickLv.setOnItemClickListener(new,OnItemClickListener(){@OverridePublic,void,onItemClick(Ad
12、apterView<,>,arg0,View,arg1,int,arg2,Long,ARG3){Arg1=arg0.getChildAt(arg2);Arg1.setOnTouchListener(new,OnTouchListener(){@OverridePublic,Boolean,onTouch(View,V,MotionEvent,event){Switch(event.getAction()){CaseMotionEvent.ACTION_DOWN:V.setBackgroundColor
13、(Color.BLUE);Break;CaseMotionEvent.ACTION_UP:V.setBackgroundColor(Color.YELLOW);Intent,intent,=new,Intent(Activity04.this,Activity03.class);V.setBackgroundColor(Color.BLACK);StartActivity(intent);}Returntrue;}});}});agreewithTwoAnswer:turntoTA_stefanie_
14、fromAndroid
15、threeteamdevelopmentallianceadoptionrate:34%Goodfield:JAVArelatedprogramming,firefighting,WarringStates,runningkart,entertainmentandleisureParticipation:anactivitythatwastemporarilyabsent;anquestioner'sassessmentofthe