How to check internet connectivity in android?
<p>friends,</p>

<p>i am trying to check internetconnectivity in android and using following code</p>

<pre><code>final ConnectivityManager conn_manager = (ConnectivityManager) 
            this.getSystemService(Context.CONNECTIVITY_SERVICE);


            final NetworkInfo network_info = conn_manager.getActiveNetworkInfo();
            if ( network_info != null &amp;&amp; network_info.isConnected() ) 
            {
                return true;
            }
            else
            {
                return false;
            }
</code></pre>

<p>but it gives me network/ wifi connectivity if wifi is connected it gives me true and if internet is not connected then it also gives me true.</p>

<p>any one guide me what is the solution?</p>
