Yes, avoid Loops
Think about Dim a global variable at Main module
called UserLogged,
for example:
Dim UserLogged as Boolean=False
Then at _Resume of all activities check if UserLogged=true
if not, then call startactivity(activitylogin)
Here user can d login or exit app
If do login then set UserLogged=true and
all activities will work....
At Main activity you can put a Button to allow user Logout and set UserLogged=False or
end app