简体   繁体   中英

Application works fine in portrait mode but crashes in landscape mode

i've made an application and the last thing i did was add landscape variation to different activities, everything works fine in portrait mode and landscape for my activities except for my home acitivty, whenever i rotate my screen the app crashes, i dont see any actual error in the logcat this is all i see:

.samsung.android.fmm-7t6JLtIv78w9SFws4HkTWw==" dev="mmcblk0p78" ino=684539 scontext=u:r:system_app:s0 tcontext=u:object_r:apk_data_file:s0 tclass=dir permissive=0 SEPF_SM-A115F_10_1021 audit_filtered
2021-06-09 04:33:18.691 647-647/? E/audit: type=1400 audit(1623205998.683:869247): avc:  denied  { write } for  pid=28307 comm="oid.sm.provider" name="com.samsung.android.lool-CWSBTk5GB0zn5KPm1k3Rpg==" dev="mmcblk0p78" ino=22145 scontext=u:r:system_app:s0 tcontext=u:object_r:apk_data_file:s0 tclass=dir permissive=0 SEPF_SM-A115F_10_1021 audit_filtered
2021-06-09 04:33:19.581 28251-28284/? E/BatteryFasDaoImpl: traverseFasDatabase : 10187 com.google.android.videosis disabled now, so we skip !!
2021-06-09 04:33:23.012 647-647/? E/audit: type=1400 audit(1623206003.003:869248): avc:  denied  { write } for  pid=28475 comm="oid.sm.provider" name="com.samsung.android.lool-CWSBTk5GB0zn5KPm1k3Rpg==" dev="mmcblk0p78" ino=22145 scontext=u:r:system_app:s0 tcontext=u:object_r:apk_data_file:s0 tclass=dir permissive=0 SEPF_SM-A115F_10_1021 audit_filtered

i've tried to solve this issue by checking answers of this quesiton: My app is crashing in landscape mode but it didnt work out for me, it still crashes, i have two different styles for portrait and landscape, this is my portrait design: 在此处输入图像描述 and this is how it should look like in landscape在此处输入图像描述 the error didnt happen when i added

android:configChanges="orientation|screenSize|keyboardHidden"

to manifest inside the home activity but the problem is it didnt show up the landscape design i made, instead it just rotated the portrait one directly, i removed the attribute screensize and the app crashed again, I have no clue how to solve this, please help me. and thank you.

in case this error happens to anyone in the future, my problem was that I've declared a button in portrait mode and forgot to add it in landscape mode, a button which I've used in another activity so it kept returning null object reference

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM