2016-08-13 63 views

回答

2

这是一样的。

在Context.java

/** 
* Retrieve styled attribute information in this Context's theme. See 
* {@link android.content.res.Resources.Theme#obtainStyledAttributes(int[])} 
* for more information. 
* 
* @see android.content.res.Resources.Theme#obtainStyledAttributes(int[]) 
*/ 
public final TypedArray obtainStyledAttributes(@StyleableRes int[] attrs) { 
    return getTheme().obtainStyledAttributes(attrs); 
} 
0
context.getTheme.obtainStyledAttributes() 

context.obtainStyledAttributes()都产生相同的结果,后者仅仅是在不直接调用themeStyle的简便方法。