rey5137/material

Redundant cast when using androidx

Closed this issue · 0 comments

This is the code
LoginBtn=(Button) findViewById(R.id.login_btn);
InputPhoneNumber=(EditText) findViewById(R.id.login_phone_no_input);
InputPassword=(EditText) findViewById(R.id.login_password_input);
And this is the error:
Caused by: java.lang.ClassCastException: androidx.appcompat.widget.AppCompatEditText cannot be cast to com.rey.material.widget.EditText
at com.example.ecommerceapp.LoginActivity.onCreate(LoginActivity.java:34)
at android.app.Activity.performCreate(Activity.java:7372)