I add following Menu item:
on my mainactivity\'s onCreateOptionsMenu(Menu menu):
onCreateOptionsMenu(Menu menu)
the mediaRouteItem.getActionView() can get the button
mediaRouteItem.getActionView()
Got the issue point after researching. Should not use android:actionProviderClass when we want to use objects in support library. Should take "http://schemas.android.com/apk/res-auto" namespace for the actionproviderClass attributes in menu item xml