Frage zu Expandable Listview

kukuk

kukuk

App-Anbieter (kostenlos)
29
Hallo, ich schaue mir gerade folgendes tutorial an:
Expandable ListView in ANDROID using SimpleExpandableListAdapter, a simple example.

hab mir das ausgesucht weil es sehr wenig code enthält und relativ überschaubar aussieht und für den anfang reicht.

Meine Frage ist jetzt, wie kann ich ein longclick auf die group und auch auf die child auslösen?

Wenn ich unter source->Override/Implents Methoden nachschaue, gibt kein onlongclick.

Danke schonmal im vorraus.
 
Hab heute in aller Ruhe nochmal nachgeschaut und jetzt läufts:

Code:
 getExpandableListView().setOnItemLongClickListener(new OnItemLongClickListener() {
   

			@Override
			public boolean onItemLongClick(AdapterView<?> parent, View view,
					int position, long id) {
				// TODO Auto-generated method stub
				 if (ExpandableListView.getPackedPositionType(id) == ExpandableListView.PACKED_POSITION_TYPE_CHILD) {
	    	            int groupPosition = ExpandableListView.getPackedPositionGroup(id);
	    	            int childPosition = ExpandableListView.getPackedPositionChild(id);
meldung();
	    	            // You now have everything that you would as if this was an OnChildClickListener() 
	    	            // Add your logic here.

	    	            // Return true as we are handling the event.
	    	            return true;
	    	        }
				 
				 if (ExpandableListView.getPackedPositionType(id) == ExpandableListView.PACKED_POSITION_TYPE_GROUP) {
	    	            int groupPosition = ExpandableListView.getPackedPositionGroup(id);
	    	            int childPosition = ExpandableListView.getPackedPositionChild(id);
meldung();
	    	            // You now have everything that you would as if this was an OnChildClickListener() 
	    	            // Add your logic here.

	    	            // Return true as we are handling the event.
	    	            return true;
	    	        }


	    	        return false;
			}
    	});
 

Ähnliche Themen

A
Antworten
1
Aufrufe
584
swa00
swa00
A
Antworten
10
Aufrufe
1.021
swa00
swa00
SpeedySix
Antworten
13
Aufrufe
1.401
jogimuc
J
Zurück
Oben Unten