๐ปTech/๐ตandroid
[์๋๋ก์ด๋] LGํฐ ์ํํธํค ์๋์ง ํ์ธํ๋ ๋ฐฉ๋ฒ
_viper_
2015. 9. 15. 17:22
๋ฐ์ํ
์๋๋ก์ด๋ ๊ฐ๋ฐํ ๋ Lgํฐ์ ์ํํธํค๋ฅผ ์ ๋ฌด๋ฅผ ํ์ธํด์ผ ํ ๊ฒฝ์ฐ๊ฐ ์ข ์ข ์๋๋ฐ์.
๊ฐ๋จํ๊ฒ ํ์ธํ ์ ์๋ ๋ฐฉ๋ฒ์ด ์์ต๋๋ค.
/**
* Lg ํฐ ์ผ ๊ฒฝ์ฐ Dp ๊ฐ ์กฐ์
*/
private void checkLgPhone() {
//๋ฉ๋ด๋ฒํผ ์ ๋ฌด
boolean hasMenuKey = ViewConfiguration.get(getApplicationContext()).hasPermanentMenuKey();
//๋ค๋ก๊ฐ๊ธฐ ๋ฒํผ ์ ๋ฌด
boolean hasBackKey = KeyCharacterMap.deviceHasKey(KeyEvent.KEYCODE_BACK);
if (!hasMenuKey && !hasBackKey) { // lgํฐ ์ํํธํค์ผ ๊ฒฝ์ฐ
Log.i("phoneType", "LGphone");
} else { // ์ผ์ฑํฐ ๋ฑ.. ๋ฉ๋ด ๋ฒํผ, ๋ค๋ก๊ฐ๊ธฐ ๋ฒํผ ์กด์ฌ
Log.i("phoneType", "Not LGphone");
}
}
if,else๋ฌธ์์ ์ํฉ์ ๋ฐ๋ผ ์ฒ๋ฆฌ ํ ์ ์์ต๋๋ค.