Today I tried to use the new android RecyclerView. I created a new project with empty activity and added it to the layout:
<android.support.v7.widget.RecyclerView android:id="@+id/my_recycler_view" android:scrollbars="vertical" android:layout_width="match_parent" android:layout_height="match_parent"/>
In the gradle build dependencies, I added:
compile 'com.android.support:support-v4:21.0.0' compile 'com.android.support:recyclerview-v7:21.+' compile 'com.android.support:cardview-v7:21.+'
But rendering activity_main.xml still shows me the following error:
Rendering Problems The following classes could not be instantiated: - android.support.v7.widget.RecyclerView (Open Class, Show Exception) Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE Exception Details java.lang.UnsupportedOperationException: Unsupported Service: accessibility at com.android.layoutlib.bridge.android.BridgeContext.getSystemService(BridgeContext.java:465
It seems that I did not find a solution on the network, as everyone says: "Add the following dependencies to your gradle build: ...", which I already added.
Can someone provide a solution?
Relationship Tak3r07
Edit: onCreate:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); }
java android xml gradle android-recyclerview
Tak3r07
source share