On Wed, Feb 23, 2011 at 3:58 PM, dashman <[email protected]> wrote: > Is it possible to write code for a certain API (e.g. 4) > > and at runtime determine what API the user is running > and if a more advanced one, make an appropriate > call to the later API function.
Yes. http://developer.android.com/resources/articles/backward-compatibility.html > specifically, i'd like to call overridePendingTransition() > but that's available in API 6 only. For something as simple as what you're describing, putting the overridePendingTransition() call in a static method of some class that you *only* reference on API 6 or higher should suffice. Here is a sample project demonstrating the use of the action bar in Android 3.0, where the one non-backwards-compatible feature (putting custom views in the action bar) is dealt with using this technique: https://github.com/commonsguy/cw-android/tree/master/Menus/ActionBarBC Specifically, look at onCreateOptionsMenu(). -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android App Developer Books: http://commonsware.com/books -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

