The ultimate reason is because android:onClick is implemented by looking
for the method on the view's Context, which will (usually) be your
Activity. Views have no concept of fragments, so there is no way for them
to find a method on a fragment or know what fragment they should even be
looking at.
On Mon, May 28, 2012 at 5:51 AM, Ralph Bergmann | the4thFloor.eu
wrote:
> Why the callback method must be in the FragmentActivity class and not in
> the Fragment class?
Because android:onClick was added in Android 1.6, well before the
existence of fragments, and we have not invented a time machin
Hello,
In the layout of my fragment I have a ImageButton where I use the
android:onClick option.
But when I tap on the button I get this error:
Failed to handle callback; interface not implemented,
callback:android.view.View$PerformClick@410a5308
java.lang.IllegalStateException: Could not find
3 matches
Mail list logo