android.content.res.Resources$NotFoundException: String resource ID #0x3de

HQ TECH UPDATES :

I had paid my 2 nights solving this shit kindly help me with this guys.

Error: there is not only one error its more than one but this is the very first one

 android.content.res.Resources$NotFoundException: String resource ID #0x3de

enter image description here

here is the MainActivity code.

        package com.example.budget;

        import androidx.appcompat.app.AppCompatActivity;

        import android.os.Bundle;
        import android.view.View;
        import android.widget.EditText;
        import android.widget.TextView;
        import android.widget.Button;

        public class MainActivity extends AppCompatActivity {
            EditText etBasicVal,etDaysAttended,etTotalDays;
            TextView tvAns;
            Button btnCalculate;

            @Override
            protected void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.activity_main);
                etBasicVal=findViewById(R.id.etBasicval);
                etDaysAttended=findViewById(R.id.etDaysAttended);
                etTotalDays=findViewById(R.id.etTotalDays);
                btnCalculate=findViewById(R.id.btnCalculate);
                tvAns=findViewById(R.id.tvAns);

                btnCalculate.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        int basicVal,daysAttended,totalDays,Ans;
                        basicVal=Integer.parseInt(etBasicVal.getText().toString());
                        daysAttended=Integer.parseInt(etDaysAttended.getText().toString());
                        totalDays=Integer.parseInt(etTotalDays.getText().toString());
                        Ans=(basicVal/totalDays)*daysAttended;
                        tvAns.setText(Ans);

                    }
                });
            }
        }

  have a look around      

          [1]: 
Pratik Butani :

setText accepting String values only. You are trying to set Integer value so getting this error.

tvAns.setText(Integer.toString(Ans));

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=27125&siteId=1