Network connectivity check in blackberry cascades 10
I'm trying to perform a network connectivity check whenever user opens the app or whenever app comes in foreground. Below is the sample code
void ApplicationUI::onFullscreen()
{
qDebug()<<"Application has entered foreground";
QNetworkConfigurationManager mgr;
QList<QNetworkConfiguration> activeConfigs = mgr.allConfigurations(QNetworkConfiguration::Activ e);
if (activeConfigs.count() > 0)
{
qDebug()<<"Has Internet connection";
}
else
{
qDebug()<<"No Internet connection";
}
}
This always prints Has Internet connection even when the network connection is off. Any ideas?