People, I was practicing a little bit here (I'm a beginner) and I came across the following problem: When I try to use a "QuickContactBadge" passing one number per parameter to the "assignContactFromPhone" method, "QuickContactBadge" does not work. I tried it this way:
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
EditText phoneField = findViewById(R.id.phoneField);
String number = phoneField.getText().toString();
QuickContactBadge quickContactBadge = findViewById(R.id.quickContactBadge);
quickContactBadge.assignContactFromPhone(number, true);
}
}
When I pass the number directly to the method, it works normally:
QuickContactBadge quickContactBadge = findViewById(R.id.quickContactBadge);
quickContactBadge.assignContactFromPhone("888888888", true);
Any idea why and how to solve the problem?