In Android FileObserver i am getting some weird event numbers like (1073742080, 1073742336) when a directory is created in the observed folder or a directory is deleted in that folder.
I am getting these event numbers consistently for folder creation and deletion. But these event numbers are not documented in FileObserver class of Android.
Can someone please explain why i am receiving this weird event only during folder creation and not on file creations? And is there any way to avoid this problem.
-Ron
I found the MOVED_TO and MOVED_FROM events have high-order bits turned on in the event flag. MOVED_FROM is 0x40000040 and MOVED_TO is 0x40000080. The workaround is to simply ‘and’ ALL_EVENTS with the event code to turn off the high bits, i.e. “event &= FileObserver.ALL_EVENTS”.