Emulator draws activity with black border

Common bugs/problems with the Android SDK the Emulator and the ADT-Plugin.

Emulator draws activity with black border

Postby Udorn » Mon Jan 17, 2011 7:02 pm

Hi,

I've written a small program with just a few activities and it's perfectly drawn on my Galaxy S. But after some starts with the emulator, it is drawn with a black border (on the left, right and bottom side - not at the top). The border has a width of nearly 20% of the total width of the emulator display.

There is a workaround to get rid off the border: When I create a new AVD, the border is not drawn. But after a few restarts it shows up again. I'm using a 2.1 (API Level 7) AVD.

One of my activites is defined like this:

Code: Select all
<?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">
   
   <LinearLayout
      android:layout_width="fill_parent" android:layout_height="wrap_content"
      android:orientation="horizontal">

        <Spinner android:id="@+id/stores"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:prompt="@string/stores_prompt"
            android:layout_weight="1"
        />

      <ImageButton android:id="@+id/name_add"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/create_contact"
        />
      
   </LinearLayout>

   <ListView android:id="@android:id/list" android:layout_width="fill_parent"
      android:layout_height="fill_parent" android:layout_weight="100"
      android:drawSelectorOnTop="false"
    />

</LinearLayout>


All activities have the same problem and it never shows up on my real device (Galaxy S).

Has anybody ever seen this emulator bug/problem? Apparently I found only one posting about that somewhere in the web for somebody who had the same probleme with the galaxy tab emulator and he hadn't any solution.
Udorn
Freshman
Freshman
 
Posts: 5
Joined: Mon Jan 17, 2011 6:49 pm

Top

Re: Emulator draws activity with black border

Postby m1shk4 » Tue Jan 18, 2011 11:50 am

Can you show how exactly is looks like?
It seems everything is ok in the layout - maybe the problem in the Java code or dpi/layout mismatch
m1shk4
Developer
Developer
 
Posts: 38
Joined: Wed Jan 12, 2011 4:26 pm
Location: UA

Re: Emulator draws activity with black border

Postby Udorn » Tue Jan 18, 2011 5:52 pm

Hi,

here are screenshots of the AVD details and the emulator view. The strange thing is, that the bug is fixed for a few executions when creating a new AVD. But after a while, without any layout changes, the bug shows up again.

I've rechecked the TabActivity description found here, and refactored the code accordingly. That didn't help.

It seems that the bug disappears, when creating an AVD without any SD-card. I'm not using a file image for the SD-card when creating an AVD, so it's completely empty. Very strange...

I haven't selected any DPI preferences. My Manifest looks like:

Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<manifest android:versionCode="1" android:versionName="1.0"
   package="org.simpleshopper" xmlns:android="http://schemas.android.com/apk/res/android">
   <application android:icon="@drawable/icon" android:label="@string/app_name">
      <activity android:label="@string/app_name" android:name=".activity.SimpleShopperActivity">
         <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
         </intent-filter>
      </activity>
      <activity android:icon="@drawable/ic_menu_compass"
         android:label="@string/all_tab" android:name=".activity.AllActivity"></activity>
      <activity android:icon="@drawable/ic_menu_share"
         android:name=".activity.BasketActivity" android:label="@string/basket_tab"></activity>
      <!-- <activity android:screenOrientation="portrait" android:name=".activity.StoreActivity"
         android:label="@string/stores" android:icon="@drawable/ic_menu_compass"></activity> -->
      <activity android:name=".activity.DatabaseActivity"></activity>
   </application>
</manifest>


Android SDK and AVD Manager_2011-01-18_16-55-07.png
Android SDK and AVD Manager_2011-01-18_16-55-07.png (35.08 KiB) Viewed 397 times
5554Android_2.png
5554Android_2.png (103.56 KiB) Viewed 397 times
Udorn
Freshman
Freshman
 
Posts: 5
Joined: Mon Jan 17, 2011 6:49 pm

Re: Emulator draws activity with black border

Postby Udorn » Tue Jan 25, 2011 6:39 pm

Now I've the problem even without a SD-card. The problem seems to be less likely without a SD card, but it also happens.

Am I really the only developer with that problem?
Udorn
Freshman
Freshman
 
Posts: 5
Joined: Mon Jan 17, 2011 6:49 pm

Re: Emulator draws activity with black border

Postby m1shk4 » Tue Jan 25, 2011 6:46 pm

I'm afraid, yes, you're the only one.
I've re-checked on all hardware I have - even Archos 101T looks ok.
It looks like an emulator problem, but I've never seen something like this :(
m1shk4
Developer
Developer
 
Posts: 38
Joined: Wed Jan 12, 2011 4:26 pm
Location: UA

Re: Emulator draws activity with black border

Postby Udorn » Thu Jan 27, 2011 6:21 pm

Yes! It seems that I've found the reason. From the very beginning of the project I still had a directory drawable-ldpi, with some images in it, especially the icons for the tabs. After having deleted it, the activities are drawn full-size again. :-)

Don't know, why the error was so undeterministic.
Udorn
Freshman
Freshman
 
Posts: 5
Joined: Mon Jan 17, 2011 6:49 pm

Top

Return to SDK/ADT/Emulator Problems

Who is online

Users browsing this forum: No registered users and 5 guests