title: If Data connection is on then show a dialog. otherwise not
body: <p>If data connection is on show a dialog box. How can I create.I am new developer so please give. MainActivity code and xml view code.</p>
  
  <pre><code>import android.app.*;
  import android.os.*;
  
  public class MainActivity extends Activity 
  {
      @Override
      protected void onCreate(Bundle savedInstanceState)
      {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
      }
  }
  </code></pre>