hbb20 / hbb20/CountryCodePickerProject

java.lang.NullPointerException: Attempt to read from field 'java.lang.String com.hbb20.CCPCountry.phoneCode' on a null object reference

Open
#522 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.5k
Forks
509
PR merge metrics
No merged PRs in 30d

Description

I am getting an error while calling fullNumberWithPlus function.

```
package com.example.invoiceinventory.Activities

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.example.invoiceinventory.R
import com.example.invoiceinventory.Utils.Constants
import com.example.invoiceinventory.databinding.ActivityAuthenticationBinding
import com.hbb20.CountryCodePicker

class AuthenticationActivity : AppCompatActivity() {
private lateinit var ccp:CountryCodePicker
private lateinit var binding:ActivityAuthenticationBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding= ActivityAuthenticationBinding.inflate(layoutInflater)
setContentView(binding.root)

ccp= CountryCodePicker(this)
ccp.registerCarrierNumberEditText(binding.authPhoneNo)

binding.authSubmitBtn.setOnClickListener {
val intent= Intent(this,OtpActivity::class.java)
intent.putExtra(Constants.phoneNum,ccp.fullNumberWithPlus.replace(" ","") )// I am getting error in this line
startActivity(intent)
}
}
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.