How to disable all touch event when a process is running on Fragments
. Our device has a built-in printer in it. while printing and rapidly tapping the screen it makes the app crash, How can I assure that the screen is untouchable?. I have tried to use
getActivity().getWindow().setFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE,WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE);
and
getActivity().getWindow().clearFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE);
and the crash still occurs. I also try to add an ID on my parent LinearLayout
and try to enable and disable it. but still, nothing happens?. What is the alternative code for it? Thanks!
Error Logs
02-26 18:16:37.000 18941-18946/com.jti.mikee.jti_pos I/dalvikvm: threadid=3: reacting to signal 3
02-26 18:16:37.060 18941-18946/com.jti.mikee.jti_pos I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
02-26 18:16:37.110 18941-18941/com.jti.mikee.jti_pos I/HAL_JNI: - native_printer_close(), result = 0
02-26 18:16:37.130 18941-18941/com.jti.mikee.jti_pos I/Choreographer: Skipped 357 frames! The application may be doing too much work on its main thread.02-26 18:16:40.740 18941-18941/com.jti.mikee.jti_pos A/libc: Fatal signal 6 (SIGABRT) at 0x00000419 (code=0), thread 18941 (i.mikee.jti_pos)
XML Layout