Create and manage android UI components in java source code can be used in the below scenario. When you want to add or remove UI components dynamically by the different conditions at run-time. When the layout XML file is too huge, it is not efficient to load so many UI components from the layout XML …
Although ActionBar provides users with a globally unified interface style and operation, it doesn’t mean that all applications’ ActionBars have to be exactly the same. If you need to modify the style of your Action Bar to better match your application, you can make it very simple by using Android styles and themes.
This example will show you how to use android.support.v7.widget.SearchView class to add a search box and implement autocomplete function for the search box. It also demos how to use android.support.v7.widget.ShareActionProvider to open the share application list for your android application. You can see the example demo video at the end of this article.