I am new to Android testing and I am trying to test a custom view in an android library and I am using Android Studio.
I found here: Android: how to check user view? which I should use ActivityUnitTestCase and layout. I placed my xml layout inside projectname / library / src / androidTest / res / layout, and my test activity knows my R id layout because of this: Setting up res srcDirs for androidTest sourceSet . My problems are in the layout content.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<eu.custom.customView
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</RelativeLayout>
In my case, " http://schemas.android.com/apk/res/android " is displayed in red with the error "URI is not registered", and the IDE doe does not recognize my custom view if I add it to this xml.
Is there a way to work with this layout without putting it in production code?
thank
source
share