Hi, I have an application with a widget. I'm trying to check
connectivity (if 3g or wifi is on) every update of the widget. I'm
trying to put these code in onupdate method of the widget but it says
me "method getSystemService(String) is undefined".

        ConnectivityManager manager = (ConnectivityManager)
getSystemService(tele.CONNECTIVITY_SERVICE);
        Boolean is3g =
manager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE).isConnectedOrConnecting();

            /*
             * wifi confirm
             */
            Boolean isWifi =
manager.getNetworkInfo(ConnectivityManager.TYPE_WIFI).isConnectedOrConnecting();

            if(is3g){

          //    updateView.setTextViewText(R.id.textoWidget, "no
conectado" );


            }else if(isWifi){

                //      updateView.setTextViewText(R.id.textoWidget, "no
conectado" );

            }else{

    //                  updateView.setTextViewText(R.id.textoWidget, "no
conectado" );
            }
I've saw that I need to provide an actual Context such as my current
Activity instance, but I don't know hot could I do these, or what is
the way to can do what I would like.
Could you help me?
Many thanks and sorry for my english!

-- 
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