I am moving this from comments to make it more understandable to others considering this issue in the future.
With the support of both old and new versions of Android, you can be confused how applications can work, despite the fact that many changes change as part of each new version, I will try to clarify this here.
An application written for 1.5 sdk can only call functions that exist for this API level, therefore, for example, multi touch api does not exist in 1.5 and never will. Now you say โOk, but I donโt need to call any new APIs, I just want my application to work in version 2.3 and support a2sd supportโ And I say โOk, just change your targetApi in the manifest, set minSDK and compile against 2.3, and you're good to go. "
Now why does it work? What if the onMeasure () method for ListView was changed to 2.2 and now calls betterCalculateFunction () inside onMeasure ()? Why is my application still running?
This is the advantage of late binding in Java. You see, Java never compiles until it reaches the device and starts up, what you do in Eclipse will convert it to byte code, which contains a bunch of byte code instructions that are later interpreted by the device. The bytecode will NEVER contain a link to betterCalculateFunction (), though (unless you call it directly). The call to onMeasure () is indirect). This can happen because when your code runs on the device, it is connected to the Android framework on the device, and your code calls onMeasure () directly, because it is an open API. The execution path will then go into the framework and call everything that it needs, and then after it is completed, it will return to your code.
So at 1.5 you can see
doStuff (your code) -> onMeasure (public API) -> done
and 2.2
doStuff (your code) -> onMeasure (open API) -> betterCalculateFunction (private function) -> done
Now, if you need to call functions that may or may not exist depending on the API level, I suggest you look at my own answer fooobar.com/questions/1337903 / ...
Hope this clarifies some things.