I am working on an app with two activities : LoginActivity and MainActivity. When the user first opens the app he will login and his credentials (u
Long story short, you cannot change the Activity that is launched by default. Update: There is an alternative as described by CommonsWare in another answer.
However, there are reasonable work arounds. In your MainActivity you can check whether the user is logged in and immediately redirect them to the LoginActivity. That has the added benefit of automatically returning to the MainActivity after you have logged in.
Alternatively, you can always go first to the LoginActivity, and if the user is already logged in, send them to the MainActivity (rewrite the Intent history to remove the return to LoginActivity or set the noHistory flag in the manifest).