It seems like AlertDialog just forces close on the app. as soon as the
notification is supposed to show, it crashes.

Anyone else got it working?

On Jul 24, 4:41 pm, Arno Becker <[email protected]>
wrote:
> Hi Ronald,
>
> try to use a builder for the dialog in the onCallStateChanged-method
> of your PhoneStateListener.It has to know the Context of your Activity
> the PhoneStateListener runs in.
>
> AlertDialog.Builder builder = new AlertDialog.Builder(context);
> builder.setMessage("Are you sure you want to exit?")
>           .setCancelable(false)
>           .setPositiveButton("Yes", new DialogInterface.OnClickListener
> () {
>                        public void onClick(DialogInterface dialog, intid) {
>                            Log.d(TAG, "onClick(): entered...");
>                        }
>            })
>            .setNegativeButton("No", new DialogInterface.OnClickListener
> () {
>                        public void onClick(DialogInterface dialog, intid) {
>                             dialog.cancel();
>                        }
>            });
>
> AlertDialog alert = builder.create();
> alert.show();
>
> On Jul 21, 2:57 pm, Ronald Pompa <[email protected]> wrote:
>
>
>
> > Hi.
>
> > I've got a PhoneStateListener to seecallstate changes, when acall
> > isincomingI make my app show a toastnotificationto displaycaller
> > data which I retrieve from a search service. Due to toasts limitation,
> > i would like to show a dialog instead which allows me to show the
> >notificationlonger and customize it with imageviews etc...
>
> > The problem is that when I implement the dialog and execute the show
> > method in the state listener class, my application crashes.
>
> > Does anyone know how to implement this and have an example? It seems
> > like WhitePages have solved this with theirCallerIDapp.
>
> >http://blog.whitepages.com/2009/02/27/caller-id-by-whitepages-a-new-a...- 
> >Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to