本文整理汇总了Java中android.net.wifi.p2p.WifiP2pManager.WIFI_P2P_DISCOVERY_STOPPED属性的典型用法代码示例。如果您正苦于以下问题:Java WifiP2pManager.WIFI_P2P_DISCOVERY_STOPPED属性的具体用法?Java WifiP2pManager.WIFI_P2P_DISCOVERY_STOPPED怎么用?Java WifiP2pManager.WIFI_P2P_DISCOVERY_STOPPED使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.net.wifi.p2p.WifiP2pManager
的用法示例。
在下文中一共展示了WifiP2pManager.WIFI_P2P_DISCOVERY_STOPPED属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onWifiP2pDiscoveryChanged
/**
* Receive events noting when Android has started or stopped looking
* for Wifi P2P peers.
*/
private void onWifiP2pDiscoveryChanged(Context context, Intent intent) {
int discoveryStateCode = intent.getIntExtra(WifiP2pManager.EXTRA_DISCOVERY_STATE, -1);
if (discoveryStateCode == WifiP2pManager.WIFI_P2P_DISCOVERY_STARTED) {
log.debug( "Device is seeking Wifi Direct peers.");
Log.d("peerDebug", "Device is seeking Wifi Direct peers.");
setSeeking(true);
} else if (discoveryStateCode == WifiP2pManager.WIFI_P2P_DISCOVERY_STOPPED) {
log.debug( "Device is NOT seeking Wifi Direct peers.");
Log.d("peerDebug", "Device is NOT seeking Wifi Direct peers.");
setSeeking(false);
} else {
log.error( "Discovery changed event didn't have an EXTRA_DISCOVERY_STATE?!");
Log.d("peerDebug", "Discovery changed event didn't have an EXTRA_DISCOVERY_STATE?!");
}
}
示例2: onWifiP2pDiscoveryChanged
/**
* Receive events noting when Android has started or stopped looking
* for Wifi P2P peers.
*/
private void onWifiP2pDiscoveryChanged(Context context, Intent intent) {
int discoveryStateCode = intent.getIntExtra(WifiP2pManager.EXTRA_DISCOVERY_STATE, -1);
if (discoveryStateCode == WifiP2pManager.WIFI_P2P_DISCOVERY_STARTED) {
Log.d(TAG, "Device is seeking Wifi Direct peers.");
setSeeking(true);
} else if (discoveryStateCode == WifiP2pManager.WIFI_P2P_DISCOVERY_STOPPED) {
Log.d(TAG, "Device is NOT seeking Wifi Direct peers.");
setSeeking(false);
} else {
Log.wtf(TAG, "Discovery changed event didn't have an EXTRA_DISCOVERY_STATE?!");
}
}