0
私は2つのapk、main、secondを持っています。私は、レイアウトに共有リソースからCardViewを展開できません
mPackName = mContext.getPackageName() + "remote_package_prefix";
mThemeContext = mContext.createPackageContext(mPackName, Context.CONTEXT_IGNORE_SECURITY);
mResources = mThemeContext.getResources();
mInflater = LayoutInflater.from(mThemeContext);
ViewGroup viewGroup = (ViewGroup) mInflater.inflate(mResources.getLayout(getRemoteId(R.layout.remote_layout)), this, true);
を膨らませるためにしようと#0x7f070001は、この問題を解決する方法CardView
ある
android.view.InflateException: Binary XML file line #20: Error inflating class <unknown>
Caused by:java.lang.reflect.InvocationTargetException
Caused by:android.content.res.Resources$NotFoundException: Resource ID #0x7f070001
at android.content.res.Resources.getValue(Resources.java:1233)
at android.content.res.Resources.getColor(Resources.java:887)
at android.support.v7.widget.CardView.initialize(CardView.java:228)
at android.support.v7.widget.CardView.<init>(CardView.java:112)
このエラーを得たんですか?
<android.support.v7.widget.CardView
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/number_item_padding_h"
android:layout_marginLeft="@dimen/number_item_padding_v"
android:layout_marginRight="@dimen/number_item_padding_v"
android:layout_marginTop="@dimen/number_item_padding_h"
card_view:cardCornerRadius="4dp" />
レイアウトファイルXMLをこの質問に含めてください – Booger
"CardView"という名前のスタイルが見つからないとします。 – Hahaido
gradleの依存関係は含まれていますか?また、バージョンがAppCompatのバージョン(つまり、両方とも23.4.1)と一致するようにしていますか? – Booger