1

I cannot explain why my app crashed several times in some particular phone. In other phones it works fine. If anyone familiar with this problem, please help. Here is my Java code, and Error log in image. It published in googleplay store. It probably happens only in Redmi note 4 phone.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.user_profile_main);
    pref = getSharedPreferences("prefName", Context.MODE_PRIVATE);

    context = MyAccountActivity.this;

    ActionBar actionBar = getSupportActionBar();
    actionBar.setTitle(R.string.toolbar_my_account);

    // add back arrow to toolbar
    if (getSupportActionBar() != null){
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setDisplayShowHomeEnabled(true);
    }

    mMyActivity = MyAccountActivity.this;

    progress = (ProgressBar)findViewById(R.id.progress_bar_account);
    progress_edit_name_bkash = (ProgressBar)findViewById(R.id.progress_edit_name_bkash);

    layoutView = (RelativeLayout)findViewById(R.id.view_profile_layout);
    layoutEdit =(LinearLayout)findViewById(R.id.layoutEdit);

    name =(TextView) findViewById(R.id.txName);
    phoneNumber =(TextView) findViewById(R.id.txtPhone);
    bKashNumber =(TextView) findViewById(R.id.txtBkashNumber_main);
    txtValidLead =(TextView) findViewById(R.id.txtValidLead);

    et_name = (EditText) findViewById(R.id.et_accountName);
    et_bKashNumber = (EditText) findViewById(R.id.et_bkashNumber);

    proPic = (ImageView) findViewById(R.id.circleView_1);

    Edit = (FloatingActionButton) findViewById(R.id.fab_edit);

    swipeLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_container);
    swipeLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
        @Override
        public void onRefresh() {
            new Handler().postDelayed(new Runnable() {
                @Override
                public void run() {
                    MainActivity.restartActivity(mMyActivity);
                    swipeLayout.setRefreshing(false);
                }
            }, 2000);
        }
    });

    swipeLayout.setColorSchemeResources(
            R.color.refresh_progress_1,
            R.color.refresh_progress_2,
            R.color.refresh_progress_3);


    mAPIService = ApiUtils.getAPIService();
    getLeadInformation();
    getUserInformation();

    submit = (AppCompatButton)findViewById(R.id.btn_submit);
    cancel = (AppCompatButton)findViewById(R.id.btn_back);

    cancel.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {

            layoutView.setVisibility(View.VISIBLE);
            layoutEdit.setVisibility(View.GONE);
            Edit.setVisibility(View.VISIBLE);
        }
    });

    submit.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {

            String name = et_name.getText().toString();
            String bKash = et_bKashNumber.getText().toString();
            progress_edit_name_bkash.setVisibility(View.VISIBLE);

            editUserInformationsApi(name,bKash);
        }
    });

    proPic.setOnClickListener(new View.OnClickListener() {

       public void onClick(View v) {
           pickImage();
       }
   });

    Edit.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            layoutView.setVisibility(View.GONE);
            layoutEdit.setVisibility(View.VISIBLE);
            Edit.setVisibility(View.GONE);
            editUserInformation();
        }
    });

}

Here the Error Log

Nazmus Saadat
  • 973
  • 9
  • 22

0 Answers0