android.view.InflateException发生在某些特定的手机中

时间:2017-08-08 13:51:52

标签: android inflate-exception

我无法解释为什么我的应用程序在某个特定手机中多次崩溃。在其他手机中它工作正常。如果有人熟悉这个问题,请帮忙。 这是我的Java代码,错误登录图像。它发布在googleplay商店。 它可能只发生在Redmi note 4手机中。

@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

0 个答案:

没有答案