Aufrufabsicht in Android
Wie kann ich machencall
durch Drücken der Taste? Ich bekomme meine Nummer als String vonEditText
. Hier ist mein Beispielcode:
<code>String phone = editPhone.getText().toString(); btnPhone.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View arg0) { call(); } }); public void call() { try { Intent callIntent = new Intent(Intent.ACTION_CALL); callIntent.setData(Uri.parse(phone)); startActivity(callIntent); } catch (ActivityNotFoundException activityException) { Log.e("myphone dialer", "Call failed", e); } } </code>
Ich habe alles hinzugefügtpermissions
Datei zu manifestieren.
aber ich bekommeNullPointerexception