네비게이션바 (navigation bar) 상태 확인

프로그래밍/Android (Java)|2017. 9. 14. 13:39
반응형

import android.view.KeyEvent;

import android.view.KeyCharacterMap;



boolean hasBackKey = KeyCharacterMap.deviceHasKey(KeyEvent.KEYCODE_BACK);

boolean hasHomeKey = KeyCharacterMap.deviceHasKey(KeyEvent.KEYCODE_HOME);


if (hasBackKey && hasHomeKey) {

    // no navigation bar, unless it is enabled in the settings

} else {

    // 99% sure there's a navigation bar

}



[출처] https://stackoverflow.com/questions/16092431/check-for-navigation-bar

반응형

댓글()