0

How can I make my android app to work only when user holds app vertical position?

I already read StackOverflow posts implement what being said there but no success.

Below is my login code where I have implemented portrait orientation:

 public class LoginActivity extends AppCompatActivity implements View.OnClickListener {

        private static final String TAG = "Login Success";
        private static final int RC_SIGN_IN = 9001;
        LoginButton login_button;
        CallbackManager callbackManager;
        GoogleSignInClient mGoogleSignInClient;
        private EditText inputEmail, inputPassword;
        private FirebaseAuth auth;
        private ProgressBar progressBar;
        private Button btnSignup, btnLogin, btnReset;
        private TextView mStatusTextView;
        private Handler fontHandler;

        @Override
        protected void onCreate(Bundle savedInstanceState) {
            setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
            super.onCreate(savedInstanceState);
        }
}

Is it possible to achieve what I want or it is impossible?

Dave Newton
  • 158,873
  • 26
  • 254
  • 302
  • https://stackoverflow.com/questions/4885620/force-portrait-orientation-mode – QAMAR Jul 09 '18 at 13:42
  • Possible duplicate of [Force "portrait" orientation mode](https://stackoverflow.com/questions/4885620/force-portrait-orientation-mode) – CodeChimp Jul 09 '18 at 16:03

0 Answers0