ConnectivityManager cm = (ConnectivityManager) this.getSystemService
(Context.CONNECTIVITY_SERVICE);
NetworkInfo ni = cm.getActiveNetworkInfo();
if(ni != null) {
}
On Jan 28, 9:46 am, "Sasikumar.S" wrote:
> Thank u for ur reply.
>
> On Thu, Jan 28, 2010 at 3:15 PM, Chander Pechetty wrote:
>
>
>
>
>
> > use ConnectivityManager and probably add the permission -
> > ACCESS_NETWORK_STATE to manifest file
>
> > On Jan 28, 12:31 pm, "Sasikumar.S" wrote:
> > > Thank You for ur reply Jian,
>
> > > I will check it and tell to you.
>
> > > On Thu, Jan 28, 2010 at 12:55 PM, Jian Chen
> > wrote:
> > > > ah, then let us come to the question how to check internet connection
> > is
> > > > not enabled or not.
> > > > Hope that below code will help.
> > > > @Override
> > > > public void onStart() {
> > > > super.onStart();
> > > > ConnectivityManager cMgr = (ConnectivityManager)
> > > > this.getSystemService(Context.CONNECTIVITY_SERVICE); #1
> > > > NetworkInfo netInfo = cMgr.getActiveNetworkInfo(); #2
> > > > this.status.setText(netInfo.toString());
> > > > }
>
> > > > ConnectivityManager can help u know current network status.
>
> > > > 在 2010年1月28日 下午3:16,Sasikumar.S 写道:
>
> > > > Hi alligator,
>
> > > >> Thank u for ur reply.
>
> > > >> I know how to create a alert dialog..
> > > >> I need how to check whether internet connection is enabled or not?..
>
> > > >> 2010/1/28 alligator
>
> > > >>> I think an alertdiaglog can do it.
>
> > > >>> Dialog dialog=new AlertDialog.Builder(this)
> > > >>> .setTitle("about")
> > > >>> .setMessage("author:ddd\n")
> > > >>> .setPositiveButton("OK", new DialogInterface.OnClickListener()
> > > >>> {
> > > >>> public void onClick(DialogInterface dialog, int
> > > >>> whichButton){
> > > >>> return;
> > > >>> }
> > > >>> })
> > > >>> .create();
> > > >>> dialog.show();
>
> > > >>> On 1月28日, 下午1时40分, "Sasikumar.S" wrote:
> > > >>> > Hi,
>
> > > >>> > How to find whether internet connection is working or not in
> > android
> > > >>> > emulator?...
>
> > > >>> > I'm doing one RSS Program.
> > > >>> > When internet connection is not enable the RSS feed is not fetching
> > the
> > > >>> data
> > > >>> > and it is showing error.
> > > >>> > So if internet connection is not enable i need to display a alert
> > that
> > > >>> > "Internet Connection Not Enabled"
>
> > > >>> > How to do this?...
>
> > > >>> > --
> > > >>> > Thanks & Regards
> > > >>> > Sasikumar.S
>
> > > >>> --
> > > >>> 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 > > >>> cr...@googlegroups.com>
> > > nsubscr...@googlegroups.com>
>
> > > >>> For more options, visit this group at
> > > >>>http://groups.google.com/group/android-developers?hl=en
>
> > > >> --
> > > >> Thanks & Regards
> > > >> Sasikumar.S
>
> > > --
> > > Thanks & Regards
> > > Sasikumar.S
>
> > --
> > 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 > cr...@googlegroups.com>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Thanks & Regards
> Sasikumar.S
--
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