I am developing an application for android, and of course I test it. When an application is tested, it’s common for applications to crash, most often these crashes are due to obvious reasons, something is not taken into account in the code. But here the problem arose on a device located far from me and I do not have the opportunity to see the logs and the cause of the fall. For some reason, string resources and many other jambs are not loaded, which for some reason are not on the overwhelming number of phones. I already asked a similar question The incomprehensible problem of the android y xiaomi program, but when the crash happened on another phone. For some reason, the program crashes ((Maybe there are some obvious reasons. At the moment I was told that the application fell on the Samsung phone. I managed to connect the problem phone and get like the reason for the fall:

08-06 15:47:45.351 3394-3394/? E/PhoneInterfaceManager: [PhoneIntfMgr] getAllowedCarriers: CommandException: com.android.internal.telephony.CommandException: REQUEST_NOT_SUPPORTED 08-06 15:47:45.355 3394-3394/? E/PhoneInterfaceManager: [PhoneIntfMgr] getAllowedCarriers: CommandException: com.android.internal.telephony.CommandException: REQUEST_NOT_SUPPORTED 

but again, I'm not sure. I just can not understand why the program works on most phones and does not work on some phones? The code on which the application crashes:

  submitBtn = findViewById(R.id.btn_submit); submitBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { sendPost(); } }); public void sendPost() { final EditText titleEt = findViewById(R.id.login); final EditText bodyEt = findViewById(R.id.password); final String a = titleEt.getText().toString().trim(); final String b = bodyEt.getText().toString().trim(); final Button btn = findViewById(R.id.btn_submit); HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor(); interceptor.setLevel(HttpLoggingInterceptor.Level.BODY); OkHttpClient client = new OkHttpClient.Builder().addInterceptor(interceptor).build(); Retrofit retrofit = new Retrofit.Builder() .baseUrl("https://сервер/") .client(client) .addConverterFactory(GsonConverterFactory.create()) .addConverterFactory(ScalarsConverterFactory.create()) .build(); APIService mAPIService = retrofit.create(APIService.class); //retrofit.create(APIService.class); mAPIService.auth(new Post(a, b)).enqueue(new Callback<GetToken>() { @Override public void onResponse(@NonNull Call<GetToken> call, @NonNull Response<GetToken> response) { if (response.isSuccessful()) { Toast.makeText(LoginActivity.this, "Post submitted to API.", Toast.LENGTH_LONG).show(); Intent intent = new Intent(LoginActivity.this, SecondScreen.class); btn.getBackground().setColorFilter(Color.parseColor("#1cd000"), PorterDuff.Mode.MULTIPLY); //TextView txt = findViewById(R.id.access_token); String token = Objects.requireNonNull(response.body()).getAccess_token(); //txt.setText(token); startActivity(intent); tok_pref = getSharedPreferences("access_token",MODE_PRIVATE); SharedPreferences.Editor editor = tok_pref.edit(); editor.putString(ACCESS_TOKEN,token); editor.commit(); saveData(); titleEt.addTextChangedListener(new TextWatcher() { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { if (s.toString().trim().length() == 0) { btn.setEnabled(false); findViewById(R.id.btn_submit).getBackground().setColorFilter(Color.parseColor("#FF0000"), PorterDuff.Mode.MULTIPLY); } else { btn.setEnabled(true); } } @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { // TODO Auto-generated method stub } @Override public void afterTextChanged(Editable s) { // TODO Auto-generated method stub } }); } else { Toast.makeText(LoginActivity.this, "Unable to submit post to API.Error!!!", Toast.LENGTH_LONG).show(); findViewById(R.id.btn_submit).getBackground().setColorFilter(Color.parseColor("#FF0000"), PorterDuff.Mode.MULTIPLY); } } @Override public void onFailure(@NonNull Call<GetToken> call, @NonNull Throwable t) { Toast.makeText(LoginActivity.this, "Unable to submit post to API.", Toast.LENGTH_LONG).show(); } }); } Заранее 

Thanks for the help and valuable advice.

  • Well, you at least write in which method it falls. The problem may be in the crooked provider of mobile communications, and in the implementation of the methods by the vendor. - Suvitruf 1:02 pm
  • setOnClickListener is that method, when you click on the button the application crashes - Andrew Goroshko
  • Code show what's inside the setOnClickListener ? - Suvitruf
  • ok, I get it)) now I’ll update the question - Andrew Goroshko
  • You have there LoginActivity starts. The problem is somewhere in it. - Suvitruf

0