androidandroid-progressbartypedarray

TypedArray ?android can't get proper value


This is what I want to achieve:

xml file

app:loaderStyle="?android:attr/progressBarStyleLarge"

code

int loaderStyle = loaderProperties.getResourceId(R.styleable.LoaderButton_loaderStyle,
            android.R.attr.progressBarStyleSmall);
...
mLoader = new ProgressBar(getContext(), null, loaderStyle);

but

loaderStyle != android.R.attr.progressBarStyleLarge

Do you know why?


Solution

  • It works but I have to consume the style attribute. Maybe for someone it will be usefull. More advanced answers are welcome

    xml file

    style="?android:attr/progressBarStyleLarge"
    

    code

    mLoader = new ProgressBar(getContext(), null, mAttributeSet.getStyleAttribute());