Unless I am doing something wrong, transparency is very flaky in 1.5.
A number of people have mentioned having to modify their colors to an
off-number, such as #cc000001. I have also noticed, on an emulator and
an actual device, where transparency no longer works (maybe out of/low
memory) and you need to reset.

This particular bug occurs when an activity is set to use the
Transparency theme, after onResume(), occasionally the window takes
focus (onWindowFocusChanged is called), but is not displayed. If you
pull down the notification bar, it forces your window to be displayed.
This same code works as expected in 1.1. To duplicate, run your
program (maybe 10 times) by starting, clicking HOME, then starting
again.

I am hoping that someone may have found a workaround, or know of a way
to force the window to be shown (as it already has focus).

Here is the code:

AndroidTest.java

package com.test.androidtest;

import android.app.Activity;
import android.database.Cursor;
import android.os.Bundle;
import android.provider.Contacts.People;
import android.util.Log;
import android.widget.ListView;
import android.widget.SimpleCursorAdapter;

public class AndroidTest extends Activity {
        protected static final String TAG = "Test";

        @Override
    public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                Log.w(TAG, "onCreate");
                setContentView(R.layout.main);
                Cursor peeps = getContentResolver().query(People.CONTENT_URI, 
new
String[] {People._ID, People.NAME, People.NOTES}, null, null, null);
                startManagingCursor(peeps);
                ListView list = (ListView) findViewById(R.id.ListView01);
                SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
                                android.R.layout.simple_list_item_1, peeps,
                                new String[] { People.NAME, People.NOTES },
                                new int[] { android.R.id.text1, 
android.R.id.text2 });
                list.setAdapter(adapter);
         }

}

main.xml

<RelativeLayout android:id="@+id/RelativeLayout01"
xmlns:android="http://schemas.android.com/apk/res/android";
android:layout_width="fill_parent" android:layout_height="200dip"
android:background="#cc000000">
<ListView android:id="@+id/ListView01"
android:layout_height="fill_parent"
android:layout_width="fill_parent"></ListView>
</RelativeLayout>

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android";
      android:versionCode="1"
      android:versionName="1.0.0" package="com.test.androidtest">
<application android:icon="@drawable/icon" android:label="@string/
app_name" android:theme="@style/Theme.Transparent">
        <activity android:name=".AndroidTest" android:launchMode="singleTop"
android:theme="@style/Theme.Transparent">
                <intent-filter>
                <action android:name="android.intent.action.MAIN"></action>
                <category android:name="android.intent.category.LAUNCHER"></
category>
        </intent-filter>
        </activity>
</application>
<uses-sdk android:minSdkVersion="2"></uses-sdk>
<uses-permission android:name="android.permission.READ_CONTACTS"></
uses-permission>
</manifest>

Using colors.xml and styles.xml from samples


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to