I have this contact information from Whatsapp: 491766465xxxx@s.whatsapp.net
Obtained from this code
void startWhatsAppContactPicker() {
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setPackage("com.whatsapp");
try {
startActivityForResult(intent, REQUEST_CODE_PICK_WHATSAPP);
} catch (Exception e) {
Toast.makeText(this, "Kein Whatsapp installiert", Toast.LENGTH_SHORT).show();
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case REQUEST_CODE_PICK_WHATSAPP:
if (resultCode == RESULT_OK) {
if (data.hasExtra("contact")) {
String address = data.getStringExtra("contact");
Log.d(TAG, "The selected Whatsapp address is: " + address);
}
}
break;
default:
break;
}
}
Outputt: 49176646xxxx@s.whatsapp.net
Is this information stored in the Android contacts?
I need the contact to get the the name of the owner.
I have tryied this but without success:
How to get whatsapp Contacts from Android?
Cheers