How do I use obtainStyledAttributes(int []) with internal Themes of Android

后端 未结 4 661
说谎
说谎 2020-12-24 09:09

So I have looked around and found out that android.R.styleable is no longer part of the SDK even though it is still documented here.

That wouldn\'t real

4条回答
  •  死守一世寂寞
    2020-12-24 09:38

    This appears to be a bug in the SDK. I have filed an issue on it, which you may wish to star so as to receive updates on it.

    As a worksaround, you can use reflection to access the field:

    Class clazz=Class.forName("android.R$styleable");
    int i=clazz.getField("Theme_backgroundDimAmount").getInt(clazz);
    

提交回复
热议问题