Preview user views in Eclipse UI Designer

Background

I have created many types of user views, and usually I get their previews that render perfectly in the ADT user interface designer.

Recently, after updating to the latest version of ADT (22.0.5.v201307292155--757759), I do not see any user view, even the simplest one.

Problem

Now I know for sure that custom views can be viewed in order, because if I create a new workspace and create them, I can see them just fine.

The problem is that in the current workspace, which has many settings for my projects, I keep getting this error:

The following classes were not found: -... (Change to ..., fix the build path, change the XML, create the class)

where "..." is the custom view class.

I also get a gray rectangle for every user view I use, and Lint also complains:

The class specified in the layout file, ..., was not found in the project or library

This is very strange since I used the correct syntax for custom views in XML (and I did this a lot). even drag & drop didn't help.

this is also strange because eclipse can find classes (using CTRL + click on the XML tag, goes directly to the correct class), it just does not find them while viewing.

I also tried removing ADT and reinstalling it, but that did not help. I also tried uninstalling and reinstalling some of the relevant components from the SDK manager. nothing helped.

here is a sample code of a custom view that doesn't display well at all:

public class CustomTextView extends TextView { public CustomTextView(Context context) { super(context); } public CustomTextView(Context context, AttributeSet attrs) { super(context, attrs); } public CustomTextView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } } 

as you can see, there is nothing special about this code.

Question

Why is this happening? how can i fix this? can I possibly copy all (and I mean everything) settings of the current workspace to a new one to solve it?

Does anyone else have this problem? Is this an ADT error?

NOTE. I do not want to reset the workspace. he has too many special settings for projects inside him.

+3
android adt android-custom-view
Aug 08 '13 at 7:07
source share
2 answers

Have you also updated the Eclipse plugin with ADT?

I know that this happened to me when it was possible that I missed.

Maybe if there are updates for the real SDK platform, update them. you can also try changing the version of the SDK that the preview uses to the latest or earlier (this is the Android icon in the upper left corner of the preview, which should say 18).

I know that some custom views are not displayed if you use shadows, for example, in text. Then you simply set the isInEditMode flag inside the user view to skip them.

At the very end, download the new zip with the ADT package and try again :)

Hope this helps somehow.

0
Aug 19 '13 at 18:32
source share

Have you included another workspace library in your new project? For example. Project-> Properties-> Android-> Library "Add" the old workspace project.

0
Mar 21 '16 at 23:40
source share



All Articles