0
public class personalData extends AppCompatActivity {

EditText[] mUserPersonalInfo = new EditText[7] ;     // 0=FULL_NAME
RadioGroup mSex;                    // 1 =BIRTHDAY
Button mNext;                       //2=ADDRESS_LINE
TextView mback;                     // 3=CITY
//4=STATE
FirebaseAuth mAuth;                 // 5=PINCODE
// 6=EMAIL
ProgressDialog progressDialog;



@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_personal_data);
    progressDialog = new ProgressDialog(this);

    // 0=FULL_NAME
    // 1 =BIRTHDAY
    //2=ADDRESS_LINE
    // 3=CITY
    //4=STATE
    // 5=PINCODE
    // 6=EMAIL
    mUserPersonalInfo[0] = findViewById(R.id.user_name);
    mUserPersonalInfo[1]=findViewById(R.id.user_birth_date);
    mUserPersonalInfo[2]=findViewById(R.id.user_address_line);
    mUserPersonalInfo[3]=findViewById(R.id.user_city);
    mUserPersonalInfo[4]=findViewById(R.id.user_state);
    mUserPersonalInfo[5] = findViewById(R.id.user_email);
    mUserPersonalInfo[6] = findViewById(R.id.user_pincode);
    mAuth = FirebaseAuth.getInstance();
    mSex=findViewById(R.id.user_sex);
    mNext = findViewById(R.id.personal_details_next_button);

    FirebaseDatabase.getInstance().setPersistenceEnabled(true);
    mNext.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            final String Birthday = mUserPersonalInfo[1].getText().toString();
            final String Name = mUserPersonalInfo[0].getText().toString();
            final String Addressline = mUserPersonalInfo[2].getText().toString();
            final String City = mUserPersonalInfo[3].getText().toString();
            final String State = mUserPersonalInfo[4].getText().toString();
            final String Email = mUserPersonalInfo[5].getText().toString();
            final String Pincode = mUserPersonalInfo[6].getText().toString();


            int selectedRadioButton = mSex.getCheckedRadioButtonId();
            final RadioButton selectedSex = findViewById(selectedRadioButton);

            //checking if empty or not
            for (int i = 0; i < 7; i++) {

                if (mUserPersonalInfo[i].getText().toString().isEmpty()) {
                    mUserPersonalInfo[i].setError("Error");
                    mUserPersonalInfo[i].requestFocus();
                    return;
                }
            }
            // checking if pincode is correct or not
            if (Pincode.length() != 6) {
                mUserPersonalInfo[5].setError("Enter valid Pincode");
                mUserPersonalInfo[5].requestFocus();
                return;
            }
            DatabaseReference currentUserDb = FirebaseDatabase.getInstance().getReference("USERS");
            DatabaseReference mperosnal_details = currentUserDb.child(userID).child("PERSONAL_DETAILS");

            mperosnal_details.child("BIRTHDAY").setValue(Birthday);
            mperosnal_details.child("EMAIL").setValue(Email);
            mperosnal_details.child("FULL_NAME").setValue(Name);
            mperosnal_details.child("GENDER").setValue(selectedSex.getText().toString());


            // set address details
            DatabaseReference mperosnal_details_permanent_address = currentUserDb.child(userID).child("PERSONAL_DETAILS").child("PERMANENT_ADDRESS");

            mperosnal_details_permanent_address.child("ADDRESS_LINE").setValue(Addressline);
            mperosnal_details_permanent_address.child("PINCODE").setValue(Pincode);
            mperosnal_details_permanent_address.child("STATE").setValue(State);
            mperosnal_details_permanent_address.child("CITY").setValue(City);

            Intent intent = new Intent(personalData.this, professionalData.class);
            startActivity(intent);


        }

    });

}
}

I have googled all around but can't find any solution can anyone help me?

THESE ARE THE ERRORS I'M GETTING

C:\Users\f2016\Downloads\android_source\Teepe\app\src\main\java\com\teepe\teepe\KYC\personalData.java: uses or overrides a deprecated API. Recompile with -Xlint:deprecation for details.

Caused by: com.android.builder.dexing.DexArchiveBuilderException: Failed to process C:\Users\f2016.gradle\caches\transforms-2\files-2.1\0696be8ea4b9a49005ad89d3832c9ecc\jars\classes.jar

Caused by: com.android.builder.dexing.DexArchiveBuilderException: Error while dexing.

Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete

Caused by: com.android.tools.r8.utils.AbortException: Error: Invoke-customs are only supported starting with Android O (--min-api 26)

Regolith
  • 2,944
  • 9
  • 33
  • 50
Chirag Gupta
  • 469
  • 1
  • 7
  • 16

0 Answers0