티스토리 뷰

타이틀바 없애는 소스


android:theme=”@android:style/Theme.NoTitleBar” 

매니패스트에서 교체하고 나면 어플 실행시 오류가 나면서 실행이 안됩니다.

메인액티비티에 Hellow World밖에 없더라도 실행이 안되는 경우를 볼 수 있습니다.



저는 약간의 테마를 사용하기 위해서 밝은색 테마에 NoTitleBar 옵션을 사용했습니다. ㅋㅋ


소스코드상으로는 분명 오류가 없는데 이상하게 실행을 시키면 앱이 죽습니다.


구글링을 해보니 해당 증상에 대한 원인과 해결책이 있었습니다.

구글 검색해보니 해당 증상에 대한 원인과 해결책이 있더군요.

http://stackoverflow.com/questions/22828118/app-crashes-after-setting-to-theme-notitlebar-fullscreen

ActionBarActivity assumes you are using an ActionBar, while Theme.NoTitleBar themes remove the ActionBar (as that is part of the title bar on newer devices and ActionBarActivityassumes you are using a Theme.AppCompat theme which controls styling for the ActionBar).

Change your activity to extend FragmentActivity if you are okay with not having an Action Bar, although as per the Android design docs is a critical component for making your app feel like an Android app (although some would say that games are granted more leeway).

간단히 요약하자면 MainActivity가 ActionBarActivity를 extends하고 있어서 발생하는 오류로, FragmentActivity를 extends 하는 것으로 바꿔주면 정상적으로 실행시킬 수 있습니다.


댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함