0
Guys, 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 a number per parameter to the "assignContactFromPhone" method, the "Quickcontactbadge" does not work. I tried that 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?
The Editext
phoneField
has some value assigned?– ramaral
Yes, I wanted to enter the number for it and when clicking on "Badge" I could save it in the contacts. When I click on it, however, it seems that the method is not triggered.
– MJG