是否有可能以编程方式接收由a [int]保存的资源-id而不引用资源类R?
<declare-styleable name="com_facebook_login_view">
<attr name="confirm_logout" format="boolean"/>
<attr name="fetch_user_info" format="boolean"/>
<attr name="login_text" format="string"/>
<attr name="logout_text" format="string"/>
</declare-styleable>
Run Code Online (Sandbox Code Playgroud)
问题是我无法解析定义的'declare-styleable'属性的ID - 始终返回0x00:
int id = context.getResources().getIdentifier( "com_facebook_login_view", "declare-styleable", context.getPackageName() );
int[] resourceIDs = context.getResources().getIntArray( id );
Run Code Online (Sandbox Code Playgroud) android ×1