Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot open XML files in Graphical Layout: FakeAdapter cannot be cast to BaseAdapter

I'm having some problems with my android project in eclipse.

I have two XML layout files, and both contain ListViews.

The ListViews are working perfectly on my Android phone, but eclipse wont open the design window, giving the following error:

com.android.layoutlib.bridge.impl.binding.FakeAdapter cannot be cast to android.widget.BaseAdapter

Both files contains the following code:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<ListView
    android:id="@+id/cardList"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:fadeScrollbars="true"
    android:fastScrollAlwaysVisible="true"
    android:fastScrollEnabled="true"
    android:scrollbarSize="30dp"
    android:scrollbarStyle="insideOverlay" >
</ListView>

</LinearLayout>

Any suggestions?

like image 937
MazZ Avatar asked Dec 04 '22 17:12

MazZ


2 Answers

It might be the

android:fastScrollAlwaysVisible="true"

that is bugging your application. Try deleting it.

like image 106
Loyalar Avatar answered Mar 02 '23 00:03

Loyalar


Just change device in layout preview.

Small screens (inches < 7) cannot preview properly. Select 10.1'' for example.

like image 38
KitKat Avatar answered Mar 01 '23 22:03

KitKat