You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
For Example, below code didn't work in the ListFragment. @ItemClick annotation is not able to use in ListFragment?
I wan't to hook the ListView click ( android.R.id.list )
@ItemClick
public void listItemClick(Item item) {
// do some
}
Activity
pyricau commentedon Dec 20, 2012
Hi @fly1ddid
What do you exactly mean by "Didn't work" ? Is there any compile error, a runtime exception, or just nothing hapenning ?
By the way, the method should be name
listItemClicked(). You forgot theed.fly1tkg commentedon Dec 20, 2012
Hi @pyricau
Sorry, I wrote this issue too brief.
I'm using android.support.v4.app.ListFragment (using android-support-v4.jar).
I wrote below code using @ItemClick, however nothing happenning.
I think onItemClickedListener is overwritten because ListFragment has onListItemClicked method.
and this is generated code.
fly1tkg commentedon Dec 20, 2012
Hi @pyricau
I examine
ListFragmentsource code.OnItemClickedListenerforListfragment#onListItemClickis set inonViewCreated().@ItemClickinjects code inonCreateView().Documents says
onViewCreated()Called immediately afteronCreateView(), soonClickListeneris overwritten.AA injects
@ItemClickcode not inonCreateView()but inonViewCreated().pyricau commentedon Dec 22, 2012
Nice one @fly1ddid, you indeed found a bug. It seems that we should override
onViewCreated(), and do the view injection / binding from there.Meanwhile, I guess you'll have to use the
onListItemClickedmethod instead of using@ItemClickPerfectCarl commentedon Dec 26, 2012
I encountered that issue, too.
Not sure it was a bug, though :)
Nice report.
atali commentedon Jan 21, 2013
Hello,
I face the same issue, how I could workaround it ?
mathieuboniface commentedon Jan 21, 2013
Hi Atali,
This issue as been fixed on the development branch, you can check out the latest snapshot built on this branch here :
https://oss.sonatype.org/content/repositories/snapshots/org/androidannotations/androidannotations-bundle/3.0-SNAPSHOT/
atali commentedon Jan 21, 2013
Thanks Mathieu, I will give a try :-)
Le 21 janv. 2013 10:19, "Mathieu Boniface" notifications@github.com a
écrit :