everyone~
I have a problem to solve. I wan开发者_运维问答t to use java code to check whether the android mobile phone turns into AP mode or not? I use google engine to search related information, but I didn't find any related issue. I hope that this problem could be solved. Thank you for your help:)i found a snipped to do this
private class TetherChangeReceiver extends BroadcastReceiver {
public void onReceive(Context content, Intent intent) {
if (intent.getAction().equals(ConnectivityManager.ACTION_TETHER_STATE_CHANGED)) {
// TODO - this should understand the interface types
ArrayList<String> available = intent.getStringArrayListExtra(
ConnectivityManager.EXTRA_AVAILABLE_TETHER);
ArrayList<String> active = intent.getStringArrayListExtra(
ConnectivityManager.EXTRA_ACTIVE_TETHER);
ArrayList<String> errored = intent.getStringArrayListExtra(
ConnectivityManager.EXTRA_ERRORED_TETHER);
}
}
}
apparently only on Android 2.3
精彩评论