android - View类中context.getTheme.obtainStyledAttributes和context.obtainStyledAttributes的区别

标签 android difference

context.getTheme.obtainStyledAttributes() 有什么区别 和 context.obtainStyledAttributes()?

主题是我的应用风格吗?

最佳答案

都是一样的

在 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);
}

关于android - View类中context.getTheme.obtainStyledAttributes和context.obtainStyledAttributes的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38933784/

相关文章:

Java如何以秒为单位获取currentMillis和过去时间戳之间的差异

python - 使用python返回excel中两个不同文件中两列之间的差异

c - 是什么让这些递归片段的速度如此不同?

java - 如何在 Firebase 中获取整个对象?

android - 使用 dialogfragment 从 datepicker 获取日期

java - Dagger 2 与注入(inject)器类

dashboard - Grafana 两个数据点之间的差异

android - 大小为 4 的 CursorIndexOutOfBoundsException 问题 :Index 4 requested,

android - 如何以编程方式在android中检测设备电源按钮按下两次

c - malloc() 和固定大小的简单声明之间的区别