13

This is my first time making an app with XML layouts. In the past I have always dynamically generated my layouts at runtime, so don't worry, I am NOT an Android newbie. Still, this is my first time with static layouts. So what's this message all about?

[2010-09-22 20:43:23 - Rockport] 'default' is not a best match for any device/locale combination.
[2010-09-22 20:43:23 - Rockport] Displaying it with 'Locale Language ___Region __, Normal Screen, Short screen aspect ratio, Landscape Orientation, No Dock, Day time, Medium Density, Finger-based touchscreen, Soft keyboard, Qwerty keybard, Trackball navigation, Screen resolution 480x320'

It gets printed to my Eclipse console every time I open up one of the layouts in the layout/ folder. If I open the layout from any other folder, such as layout-land/ then I get no message. Is it just the graphical layout editor saying, "Here's how I'm going to display things for you?" Can I safely ignore it?

blahdiblah
  • 33,069
  • 21
  • 98
  • 152
Neil Traft
  • 18,367
  • 15
  • 63
  • 70

3 Answers3

13

No don't ignore it, it does mean something.

What it is saying is that Eclipse has found a layout which it believes is more accurate and is switching to it.

So for example if you have a default layout and a low density layout, it will switch to the low density layout. Any changes you make to the layout will be in the low density code not in the default code.

I don't know how to switch back, which is getting very annoying, apart from closing the xml and opening up the correct one.

If anyone knows how to switch, and yes I have tried changing the settings at the top of the editor between low density and medium density devices, please tell me. Thanks.

user492822
  • 146
  • 2
  • 3
  • Wow, can this really be true? I'm skeptical because I should think I would've noticed eventually that I had made changes to the wrong layout. Then again, I did have a hard time keeping multiple various layouts in sync with each other, so maybe this is why. I will definitely have to test this when I find the time! – Neil Traft Dec 11 '10 at 13:31
10

Do not run the project with the file XML selected. Clean build the project, Only click in the project name, after select run, you won't have this error

MysticMagicϡ
  • 28,593
  • 16
  • 73
  • 124
Romel Hdez
  • 101
  • 1
  • 2
0

I had this problem and for me just solved by selecting my projects "MainActivity" from dropdown menu "Associated activity or fragment providing context" in the graphical view of my layout.

Morteza
  • 550
  • 1
  • 7
  • 22