Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
With the exception of the custom view feature described in the preceding section, everything shown in this chapter regarding the action bar is automatically backward compatible. The code and resources that work on Ice Cream Sandwich–flavored versions of Android will work on classic versions of Android unmodified.
If, however, you want to use the custom view feature, you have a problem—the getActionView() method was new to API Level 11 and will be unavailable on older versions of Android. This means you will need to compile for at least API Level 11 (e.g., set your Eclipse target or Ant default.properties to reference android-11) or higher, and you will need to take steps to avoid calling getActionView() on older devices. We will explore how to pull off this feat in a later chapter.