
smalldevice
Neues Mitglied
- 0
Hallo Gemeinde,
ich habe ein Problem mit Intent.ACTION_CALL
wenn ich folgenden Code ausführe (von dem ich erwarte, dass er die entsprechenden Telefonnummer wählt)
// Anruf tätigen
private void call(String number)
{
//** FUNKTIONIERT NICHT
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:"+number));
startActivity(callIntent);
// WORKAROUNT ÜBER .ACTION_DIAL und .FLAG_ACTIVITY_NEW_TASK
//Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + number));
//intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
//startActivity(intent);
}
Ich bekomme im log die Fehlermeldung: "requires android.permission CALL_PHONE"
Bei stackoverflow habe ich gefunden, dass hier die entsprechende permission in der Manifestdatei einzutragen ist. Habe ich gemacht (s.u.) funktioniert aber immer noch nicht!
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.carpelibrum.sqlite"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk
android:minSdkVersion="8"
android:name="android.permission.CALL_PHONE"/>
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".SQLiteDemo"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Für etwas Hilfe wäre ich sehr dankbar!
sd
P.S.
Der Workaround funktioniert. Ich will aber nicht den Umweg gehen, sondern direkt aus meiner app die Nummer wählen.
ich habe ein Problem mit Intent.ACTION_CALL
wenn ich folgenden Code ausführe (von dem ich erwarte, dass er die entsprechenden Telefonnummer wählt)
// Anruf tätigen
private void call(String number)
{
//** FUNKTIONIERT NICHT
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:"+number));
startActivity(callIntent);
// WORKAROUNT ÜBER .ACTION_DIAL und .FLAG_ACTIVITY_NEW_TASK
//Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + number));
//intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
//startActivity(intent);
}
Ich bekomme im log die Fehlermeldung: "requires android.permission CALL_PHONE"
Bei stackoverflow habe ich gefunden, dass hier die entsprechende permission in der Manifestdatei einzutragen ist. Habe ich gemacht (s.u.) funktioniert aber immer noch nicht!
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.carpelibrum.sqlite"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk
android:minSdkVersion="8"
android:name="android.permission.CALL_PHONE"/>
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".SQLiteDemo"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Für etwas Hilfe wäre ich sehr dankbar!
sd
P.S.
Der Workaround funktioniert. Ich will aber nicht den Umweg gehen, sondern direkt aus meiner app die Nummer wählen.