hbb20 / hbb20/CountryCodePickerProject
Ihave this error :Attempt to invoke virtual method 'void com.hbb20.CountryCodePicker.registerCarrierNumberEditText(android.widget.EditText)' on a null object reference
- 主要言語
- Java
- スター
- 1.5k
- フォーク
- 509
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
package com.example.geolab;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import com.hbb20.CountryCodePicker;
public class PhoneLoginActivity extends AppCompatActivity {
private CountryCodePicker ccp;
private EditText userPhoneNumber;
private Button cuntiniueToVerify;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
InitializeFields();
cuntiniueToVerify.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view)
{
Intent OTPintent = new Intent(PhoneLoginActivity.this,OTPActivity.class);
OTPintent.putExtra("mobile",ccp.getFullNumberWithPlus().replace(" ",""));
startActivity(OTPintent);
}
});
}
private void InitializeFields()
{
userPhoneNumber = (EditText) findViewById(R.id.phone_number_id);
ccp = (CountryCodePicker) findViewById(R.id.ccp);
ccp.registerCarrierNumberEditText(userPhoneNumber);
cuntiniueToVerify = (Button) findViewById(R.id.cuntiniue_button);
}
}
//------------------------------------------------------layout-------------------------------------------
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
Start with the pasted PhoneLoginActivity, especially InitializeFields(), and compare its findViewById calls with the embedded layout XML. Reproduce the crash at registerCarrierNumberEditText and determine why the CountryCodePicker lookup is null. Done means the phone-login screen initializes without this null-reference exception.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- android, java
- 領域
- mobile
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 25/100