Reputation: 805
Hi I Have 3 tabs in one sceen.. first tab:some edittext fields with some data in disable mode.initially only one button will be there ie "edit",when u click "edit" then fields will change to editable mode.and "save","cancel" buttons will come.
My Requirment:if we change data in edittext fields and if u are trying to change tab I should display an alert box saying that "do u want to save data?"
can any one tell how can i achive this? thanks in advance
Upvotes: 0
Views: 358
Reputation: 3926
Just implement OnTabChangeListner in main activity and in this check whether edit text is in editable mode.u can check it by using a flag. set flag when user press on edit button. if flag is true then show alert.
Upvotes: 1