My app works just fine when I use a color code for my Buttons background in my layout. Something like:
android:background="#ff6699"
But it stops working when I replace the color code with my drawable:
android:background="@drawable/blue_background_round_corners"
This means, there is obviously something wrong with my drawable. Any idea what? My drawable:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<solid android:color="#ff6699"></solid>
<corners android:radius="10dp"/>
</shape>
</item>
</selector>
by the way, I am using data binding. My fragment:
public class MainFragment extends Fragment {
FragmentMainBinding binding;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
binding = DataBindingUtil.inflate(inflater, R.layout.fragment_main, container, false);
View v = binding.getRoot();
v.setClickable(true);
v.setFocusable(true);
return v;
}
}