You are doing it wrong, you should NOT load layouts in FirstTime, that only triggers when the app runs for the VERY FIRST TIME.
1 exemple
make a main activity
make a login activity
make a register activity
and make a principal activity
OK TOTAL 4 LAYOUTS
now you open the app(main), click at register and open register activity.
ok later your register done go to principal and close the current activity (register).
now you is on the principal activity and you want make a logoff and register another account.
you close the principal activity and open register again. = Memory error because you is loading layout again
if you use first time here you have layout not initializated if you dont use have memory error