Error while inflating class ripple

I'm trying to use ripple in action bar tabs and then when the action bar is clicked it shows ripple. But it doesn't work. Here is my code snippet. I provide the colors.xml and my custom_bg.xml code. I have another style.xml file

    public void onTabSelected(Tab tab, FragmentTransaction ft) {


    String value = tab.getText().toString();
    Log.d("You Selected", value);

    if (value.equalsIgnoreCase("Messages")) {
        tab.setCustomView(R.drawable.custom_bg);//Here it shows error
        webView.loadUrl("javascript:openTabPage('mobilePageMessagesNavLink');", null);

    } 

  custom_bg.xml
 <?xml version="1.0" encoding="utf-8"?>
 <ripple xmlns:android="http://schemas.android.com/apk/res/android" 
  android:color="?android:attr/colorControlHighlight" >
  </ripple>

      

colors.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorHighlight">#FF6600</color>
</resources>

      

+3


source to share





All Articles