I found a solution. defStyle parameter is not needed for it. All I need exists in attrs parameter. TypedArray attrsArray = context.obtainStyledAttributes(attrs, R.styleable.MyComponent); bg = attrsArray.getResourceId(R.styleable.MyComponent_attribute, defaultId);
On 15 ноя, 22:38, Vitaliy Tarasenko <[email protected]> wrote: > Hello. I have a problem. > Any View have a constructor > public View (Context context, AttributeSet attrs, int defStyle) which > called when View declared with a style attribute > So, if I have some class inherited from View class, I can access to > declared attributes (like "android:layout_width" or > "android:background") via AttributeSet attrs in a constructor. But > when I move attributes to style I cannot see attributes and values > exists in a style - I want to read items declared in style but I have > only styleID in defStyle parameter. Is there some way to read style > Items using styleID? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

