Button Click Event Not Firing In Second View Of A Viewflipper
I have a layout in xml that, when the user clicks a 'next' button I inflate, populate with the next screen's data, and create and set the onclicklistener for an imagebutton in the
Solution 1:
Removing the in / out animations from your ViewFlipper, or alternatively settings:
android:fillAfter="false"android:fillBefore="false"
on your in / out animations will solve the problem and you'd be able to use the standard XML defined onClick listeners.
Solution 2:
I just spent the last four hours figuring this out. I think it's just a work around, but it gets me to the place where I can get my button clicks for views further than the first one. In your xml, use --
android:onClick="onClick"
Then in your code, use the below format for listening to your button events..
publicvoidonClick(View vw)
{
switch (vw.getId())
{
case R.id.continue_button:
if(verifyAllTasksCompleted()){
currentPage++;
updateView();
}
break;
Hope this helps you. Iris
Post a Comment for "Button Click Event Not Firing In Second View Of A Viewflipper"