본문 바로가기
Android Dev

[안드로이드] 카메라 회전시 죽는 문제

by 필팔청춘 2013. 5. 24.



에러 로그

05-23 18:53:32.651: E/AndroidRuntime(17993): java.lang.RuntimeException: Unable to resume activity {com.changjaeso.hms/com.changjaeso.hms.LinkAddMain}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=link_tab_2, request=0, result=-1, data=null} to activity {com.changjaeso.hms/com.changjaeso.hms.LinkAddMain}: java.lang.NullPointerException

05-23 18:53:32.651: E/AndroidRuntime(17993): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2825)

05-23 18:53:32.651: E/AndroidRuntime(17993): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2854)

05-23 18:53:32.651: E/AndroidRuntime(17993): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2301)

05-23 18:53:32.651: E/AndroidRuntime(17993): at android.app.ActivityThread.access$700(ActivityThread.java:151)

05-23 18:53:32.651: E/AndroidRuntime(17993): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1281)

05-23 18:53:32.651: E/AndroidRuntime(17993): at android.os.Handler.dispatchMessage(Handler.java:99)

05-23 18:53:32.651: E/AndroidRuntime(17993): at android.os.Looper.loop(Looper.java:137)

05-23 18:53:32.651: E/AndroidRuntime(17993): at android.app.ActivityThread.main(ActivityThread.java:5293)

05-23 18:53:32.651: E/AndroidRuntime(17993): at java.lang.reflect.Method.invokeNative(Native Method)

05-23 18:53:32.651: E/AndroidRuntime(17993): at java.lang.reflect.Method.invoke(Method.java:511)

05-23 18:53:32.651: E/AndroidRuntime(17993): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)

05-23 18:53:32.651: E/AndroidRuntime(17993): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)

05-23 18:53:32.651: E/AndroidRuntime(17993): at dalvik.system.NativeStart.main(Native Method)

05-23 18:53:32.651: E/AndroidRuntime(17993): Caused by: java.lang.RuntimeException: Failure delivering result ResultInfo{who=link_tab_2, request=0, result=-1, data=null} to activity {com.changjaeso.hms/com.changjaeso.hms.LinkAddMain}: java.lang.NullPointerException

05-23 18:53:32.651: E/AndroidRuntime(17993): at android.app.ActivityThread.deliverResults(ActivityThread.java:3405)

05-23 18:53:32.651: E/AndroidRuntime(17993): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2812)

05-23 18:53:32.651: E/AndroidRuntime(17993): ... 12 more

05-23 18:53:32.651: E/AndroidRuntime


(17993): Caused by: java.lang.NullPointerException

05-23 18:53:32.651: E/AndroidRuntime(17993): at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:503)

05-23 18:53:32.651: E/AndroidRuntime(17993): at com.changjaeso.hms.AddLinkWrite.onActivityResult(AddLinkWrite.java:787)

05-23 18:53:32.651: E/AndroidRuntime(17993): at android.app.ActivityGroup.dispatchActivityResult(ActivityGroup.java:122)

05-23 18:53:32.651: E/AndroidRuntime(17993): at android.app.ActivityThread.deliverResults(ActivityThread.java:3401)

05-23 18:53:32.651: E/AndroidRuntime(17993): ... 13 more




해결책

메니페스트에 아래 내용을 갖다 붙이세요. (카메라 불리기전 Activity에 해당하는 곳에!)

android:configChanges="keyboardHidden|orientation|keyboard" 

android:windowSoftInputMode="stateAlwaysHidden|adjustPan" 



ex)

<activity android:name=".HMSTab" android:screenOrientation="portrait" 

            android:configChanges="keyboardHidden|orientation|keyboard" 

            android:windowSoftInputMode="stateAlwaysHidden|adjustPan" 

            android:launchMode="singleTask" />


주의 : Tab액티비티나 기타 동시에 열리는 곳 모두에다가 해줘야해요.



도움이 되셨다면 허니브릿지 광고좀 할께요.. ㅎ