Where does your context ("ctx") come from? I'm curious because I want
to do the same thing, but getting a correct context to pass to
Toast.makeText is the only part I can't figure out.

On Dec 3, 2:49 pm, vekexasia <vekexa...@gmail.com> wrote:
> hi, on my onCreate() Activity function i wrote this:
> <--
>         CambioCellula myCellula=new CambioCellula();
> ...
>         TelephonyManager x=(TelephonyManager)this.getSystemService
> (Context.TELEPHONY_SERVICE);
>         x.listen(myCellula, PhoneStateListener.LISTEN_CELL_LOCATION);
> -->
> Where CambioCellula is my class defined like this excerpt
> <--
> public class CambioCellula extends PhoneStateListener {
> ....
>         public void onCellLocationChanged(CellLocation location) {
>                 GsmCellLocation myLocation=(GsmCellLocation)location;
>                 Log.d("X","Y");
>                 Toast.makeText(ctx, "Found New Cells
> "+myLocation.getCid(),Toast.LENGTH_LONG ).show();
>         }
>
> }
>
> -->
> The program works when the screen is on .. But when i shut down the
> Screen  ( with a short press of the end-call button) it seems to
> doesn't
> work..
>
> IS this an sdk problem? Am i doing something wrong?
> Are you familiar with this kind of "bugs" ?
> Thanks Andrea.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to