After reading 2 books on Android programming, I am trying to port an iOS Word game app:

word game screenshot

I would like to have 2 classes inheriting from View - and

Both classes should be composed of an ImageView (id: "image") and 2 TextViews (ids: "letter" and "value").

The difference between them is that BigTile will be draggable and its "image" has a shadow.

I have put the graphical assets into the directory res/drawable-mdpi and I am trying to refer to them from the layout files res/layout/small_tile.xml and res/layout/big_tile.xml as:

<?xml version="1.0" encoding="utf-8"?>
<ImageView xmlns:android=""
    android:src="@drawable/small_tile.png" >

But I get the error

No resource found that matches the given name (at 'src' with value '@drawable/small_tile.png')

as you can see in the Eclipse-screenshot (here fullscreen):

eclipse screenshot

I have tried other paths for my assets as well - for example res/drawables and src/assets.

Also another question: how to load the layout files from a View?

There is only an ImageView in the res/layout/small_tile.xml right now, but I'd like to add the two TextViews there too (for the letter and its numerical value) - and then load it from the

From the programming books I know how to load a layout from Activity or Fragment - call setContentView(R.layout.activity_main); in onCreate - but where and what to call in a View class?

Related posts

Recent Viewed