Android auth-dialog when app starts
===

I have some questions. I'm trying to do auth-dialog, where user enters pass to work with app. Entered pass I store in SharedPreferences. So, the 1-st question: is this right idea from the security point of view to store password in that way ?

2nd and the main question: this dialog must be opened ONLY when app starts. Now it's done in onCreate() - method. But it's not right, because, for example: I run app, enter pass, clicked Ok-button and dialog closed. But when I change the rotation of screen, this dialog opens again, because when we rotate screen, Activity destroyed and onCreate()-method called again. So, where should I place code that opens my auth dialog, to open it only when app starts ?

Thanks for all answers !