#android #layout
#Android #макет
Вопрос:
У меня проблема с моим XML-файлом макета.. Моя ошибка;
Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo android.content.res.Resources$NotFoundException: File res/layout/activity_splash.xml from xml type layout resource ID #0x7f040031
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2313)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2365)
at android.app.ActivityThread.access$600(ActivityThread.java:156)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:153)
at android.app.ActivityThread.main(ActivityThread.java:5336)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(NativeStart.java)
и мой XML-макет;
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:wheel="http://schemas.android.com/apk/res-auto"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".SplashActivity">
<com.pnikosis.materialishprogress.ProgressWheel
android:id="@ id/progress_wheel"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
wheel:matProg_barColor="#E5E4E2"
wheel:matProg_progressIndeterminate="true" />
</RelativeLayout>
и вот моя строка ошибки;
setContentView(R.layout.activity_splash);
в чем моя проблема? большое спасибо на данный момент…
Ответ №1:
добавление зависимостей build.gradle:
compile 'com.pnikosis:materialish-progress:1.7'
Или в коде:
ProgressWheel wheel = new ProgressWheel(context);
wheel.setBarColor(Color.BLUE);
пожалуйста, проверьте, что вы добавили в файл build.gradle