Android : Android Alert dialog based on if - else statement

on Monday, August 11, 2014


I'm very new to Android programming and am a bit stuck.


I have a log in screen and a separate class for each of the alert dialogs ( both have OK and close buttons) .


Based on what kind of user logs in I need to display a certain alert ( ie: admin logs in , there is a popup with an "Administrator is now logged in. " ).


I have an if - else statement in my code for the log in activity and after parsing of a json object and deciding whether the user is normal or admin , when the Log in button is clicked the popup message must appear.



if ( member.isadmin() == 1 ) {
// alertdialog for admin logged in
}

else {
// alertdialog for user
}

0 comments:

Post a Comment