I want my app to be able to be run on pre Android 2.0 operating systems (namely 1.5 and 1.6). I need to include Activity.onAttachedToWindow() for 2.0 and above. How can I use reflection (or any other approach) to make my app work property on pre-2.0 Android operating systems?
Share
Activity‘sonAttachedToWindowis empty. This means you can avoid callingsuper.onAttachedToWindow. So the easiest way would be:Android OS will call your
onAttachedToWindowon Api Level 5+ (2.0+). And on 1.5/1.6 this function is just never called.If you want to call implementation of
onAttachedToWindowfrom super class via reflection: