Nummer 112 anrufen

  • 4 Antworten
  • Neuester Beitrag
Diskutiere Nummer 112 anrufen im Android App Entwicklung im Bereich Betriebssysteme & Apps.
Z

zblack

Gast
Hallo Freunde.
ich habe da ne kurze Frage.
ich habe in einer App folgende Funktion geschrieben.
Code:
public void onClick(View v) {
        // TODO Auto-generated method stub
        switch (v.getId()) {
        //Wähle die Nummer 110
        case R.id.button110:
            try {
                Intent callIntent = new Intent(Intent.ACTION_CALL);
                callIntent.setData(Uri.parse("tel:110"));        
                c = getContext();
                c.startActivity(callIntent);
            } catch (ActivityNotFoundException activityException) {
                Log.e("helloandroid dialing example", "Call failed",
                        activityException);
            }
            break;
        
        //Wähle die Nummer 112
        case R.id.button112:
            try {
                Intent callIntent = new Intent(Intent.ACTION_CALL);
                callIntent.setData(Uri.parse("tel:112"));
                c = getContext();
                c.startActivity(callIntent);
            } catch (ActivityNotFoundException activityException) {
                Log.e("helloandroid dialing example", "Call failed",
                        activityException);
            }
            break;

        //Wähle die ADAC Nummer
        case R.id.buttonadac:
            try {
                Intent callIntent = new Intent(Intent.ACTION_CALL);
                callIntent.setData(Uri.parse("tel:222222"));
                c = getContext();
                c.startActivity(callIntent);
            } catch (ActivityNotFoundException activityException) {
                Log.e("helloandroid dialing example", "Call failed",
                        activityException);
            }
            break;
            
        case R.id.schliessen_dialog:
            dismiss();
            break;
        }
Bei der Ausführung der App aufm Handy funktioniert die Einwahl der Nummer 110 und der ADAC Nummer. Wenn ich das Button für die Einwahl der Nummer 112 klicke, kommt die Meldung :"Sorry. Der Prozess com.android.phone wurde unerwartet angehalten. Versuchen Sie es erneu. Beenden erzwingen."
Weiss jemand was da los ist ? Die Funktionsweise ist doch für jede Nummer die gleiche.
 
Zuletzt bearbeitet von einem Moderator:
N

nijoX

Neues Mitglied
dein logcat weiß wahrscheinlich mehr, das solltest dir mal ansehen wenn die App abschmiert. Wenn du damit nichts anfangen kannst wäre es ratsam den auszug hier zu posten.

MfG nijoX
 
Z

zblack

Gast
log cat sagt das hier
11-04 08:01:28.288: I/ActivityThread(29575): queueIdle
11-04 08:01:28.288: V/ActivityThread(29575): Reporting idle of ActivityRecord{4a504f10 token=android.os.BinderProxy@4a504990 {de.meinautohaus/de.meinautohaus.StartActivity}} finished=false
11-04 08:01:28.288: W/ActivityNative(29575): send ACTIVITY_IDLE_TRANSACTION
11-04 08:01:42.598: I/ActivityThread(29575): queueIdle
11-04 08:01:42.598: V/ActivityThread(29575): Reporting idle of ActivityRecord{4a504f10 token=android.os.BinderProxy@4a504990 {de.meinautohaus/de.meinautohaus.StartActivity}} finished=false
11-04 08:01:42.598: W/ActivityNative(29575): send ACTIVITY_IDLE_TRANSACTION
11-04 08:01:46.948: I/ActivityThread(29575): queueIdle
11-04 08:01:46.948: V/ActivityThread(29575): Reporting idle of ActivityRecord{4a500638 token=android.os.BinderProxy@4a5000a0 {de.meinautohaus/de.meinautohaus.MeinAutohausStartActivity}} finished=false
11-04 08:01:46.948: W/ActivityNative(29575): send ACTIVITY_IDLE_TRANSACTION
11-04 08:01:49.898: I/ActivityThread(29575): queueIdle
11-04 08:01:49.898: V/ActivityThread(29575): Reporting idle of ActivityRecord{4a537030 token=android.os.BinderProxy@4a536a98 {de.meinautohaus/de.meinautohaus.UnfallPannenHilfeActivity}} finished=false
11-04 08:01:49.898: W/ActivityNative(29575): send ACTIVITY_IDLE_TRANSACTION
11-04 08:01:57.038: I/ActivityThread(29575): queueIdle
11-04 08:01:57.038: V/ActivityThread(29575): Reporting idle of ActivityRecord{4a500638 token=android.os.BinderProxy@4a5000a0 {de.meinautohaus/de.meinautohaus.MeinAutohausStartActivity}} finished=false
11-04 08:01:57.038: W/ActivityNative(29575): send ACTIVITY_IDLE_TRANSACTION
11-04 08:01:57.068: E/WindowManager(29575): Activity de.meinautohaus.UnfallPannenHilfeActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@4a53e420 that was originally added here
11-04 08:01:57.068: E/WindowManager(29575): android.view.WindowLeaked: Activity de.meinautohaus.UnfallPannenHilfeActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@4a53e420 that was originally added here
11-04 08:01:57.068: E/WindowManager(29575): at android.view.ViewRoot.<init>(ViewRoot.java:247)
11-04 08:01:57.068: E/WindowManager(29575): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)
11-04 08:01:57.068: E/WindowManager(29575): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
11-04 08:01:57.068: E/WindowManager(29575): at android.view.Window$LocalWindowManager.addView(Window.java:424)
11-04 08:01:57.068: E/WindowManager(29575): at android.app.Dialog.show(Dialog.java:241)
11-04 08:01:57.068: E/WindowManager(29575): at de.meinautohaus.UnfallPannenHilfeActivity.onOptionsItemSelected(UnfallPannenHilfeActivity.java:78)
11-04 08:01:57.068: E/WindowManager(29575): at android.app.Activity.onMenuItemSelected(Activity.java:2195)
11-04 08:01:57.068: E/WindowManager(29575): at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:743)
11-04 08:01:57.068: E/WindowManager(29575): at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:143)
11-04 08:01:57.068: E/WindowManager(29575): at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:855)
11-04 08:01:57.068: E/WindowManager(29575): at com.android.internal.view.menu.MenuDialogHelper.onClick(MenuDialogHelper.java:137)
11-04 08:01:57.068: E/WindowManager(29575): at com.android.internal.app.AlertController$AlertParams$3.onItemClick(AlertController.java:874)
11-04 08:01:57.068: E/WindowManager(29575): at android.widget.AdapterView.performItemClick(AdapterView.java:284)
11-04 08:01:57.068: E/WindowManager(29575): at android.widget.ListView.performItemClick(ListView.java:3672)
11-04 08:01:57.068: E/WindowManager(29575): at android.widget.AbsListView$PerformClick.run(AbsListView.java:1829)
11-04 08:01:57.068: E/WindowManager(29575): at android.os.Handler.handleCallback(Handler.java:587)
11-04 08:01:57.068: E/WindowManager(29575): at android.os.Handler.dispatchMessage(Handler.java:92)
11-04 08:01:57.068: E/WindowManager(29575): at android.os.Looper.loop(Looper.java:123)
11-04 08:01:57.068: E/WindowManager(29575): at android.app.ActivityThread.main(ActivityThread.java:4633)
11-04 08:01:57.068: E/WindowManager(29575): at java.lang.reflect.Method.invokeNative(Native Method)
11-04 08:01:57.068: E/WindowManager(29575): at java.lang.reflect.Method.invoke(Method.java:521)
11-04 08:01:57.068: E/WindowManager(29575): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
11-04 08:01:57.068: E/WindowManager(29575): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
11-04 08:01:57.068: E/WindowManager(29575): at dalvik.system.NativeStart.main(Native Method)
 
N

Nebukad

Neues Mitglied
Du kannst keine Notrufnummer mit Intent.ACTION_CALL anrufen.
public static final String ACTION_CALL

Since: API Level 1
Activity Action: Perform a call to someone specified by the data.
Input: If nothing, an empty dialer is started; else getData() is URI of a phone number to be dialed or a tel: URI of an explicit phone number.
Output: nothing.
Note: there will be restrictions on which applications can initiate a call; most applications should use the ACTION_DIAL.
Note: this Intent cannot be used to call emergency numbers. Applications can dial emergency numbers using ACTION_DIAL, however.
 
Z

zblack

Gast
oh, vielen dank. das habe ich garnicht gewusst.
Naja mit ACTION_DIAL klappts auch.
Vielen Dank.