android - Removing login screen from stack after login -


i have login screen in android app , after login main screen comes.

what appropriate way not allow login screen appear again after successful login.

should put check in oncreate of login activity. set appropriate flag intent of main screen

  • if not appropriate appropriate flag this.

another problem main screen have links various sections of app. user may leave app @ page of subsection of app. eg: user may view various products using product section main screen.

  • is possible start off main screen when there error in subsection activity. eg: if product page crashes , app returns starting page of products whereas require start main screen.

  • is possible through flag setting in activity tag or need check property in oncreate , accordingly navigate main-screen.

kindly update.

thanks

you can use intent flag such result.in app use below code -

intent = new intent(mcontext, dashboardactivity.class); i.setflags(intent.flag_activity_clear_top); startactivity(i); finish(); 

it way login screen not appear after login if user presses button. set flag in sharedpreference is_user_login = true , in next launch of app check preference value , take action according it. hope you.


Comments