title: getAllNetworkInfo detect wifi or mobile connection, but never both
body: <p>I have a function which check network connections using:</p>
  
  <pre><code>ConnectivityManager cm = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);
  NetworkInfo[] networkInfos = cm.getAllNetworkInfo();
  </code></pre>
  
  <p>but, as soon the Wifi network is connected, the mobile network is given as DISCONNECTED</p>
  
  <p>How could I know if both networks are connected?</p>
  
  <p>Thanks in advance for your time.</p>