private void detectWifiDebug() {
mSettingsObserver = new ContentObserver(mHandler) {
@Override
public void onChange(boolean selfChange, Uri uri) {
/* do stuff, for some reason when it turns on this is called twice */
}
};
getContentResolver().registerContentObserver(
Settings.Global.getUriFor("adb_wifi_enabled"), false,
mSettingsObserver);
}
1条答案
按热度按时间92dk7w1h1#
我发现这个代码似乎工作。