Custom translucent theme

by Olivier Guilyardi » Fri, 16 Oct 2009 23:03:31 GMT


Sponsored Links
 Hi,

I have 2 activities and need the second one to be translucent when
started by and over the first one.

When I set my activity theme to @android:style/Theme.Translucent, it
works.

I however want to customize alpha. So, following the example in
ApiDemos - app - TranslucentActivity, I write:

in styles.xml:

    <style name="Theme" parent="android:Theme">
    <style name="Theme.Translucent" parent="android:style/
Theme.Translucent">
        <item name="android:windowBackground">@drawable/
translucent_background</item>
        <item name="android:windowNoTitle">true</item>
        <item name="android:colorForeground">#fff</item>
    </style>

and in colors.xml:

    <drawable name="translucent_background">#80000000</drawable>

and set my activity theme to @style/Theme.Translucent

But it doesn't work any more, the second activity is black and opaque.

I also tried with (notice the @) :
<style name="Theme.Translucent" parent="@android:style/
Theme.Translucent">

What's wrong ?
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. How can i check the permissions on a Folder

I want to know how can we check the permissions on a folder? like the /
data folder at android's root, if we create a file browser and click
on it, it will show us nothing because we don't have permissions to
view it's content as a user.  so what i want to do is, i want to
display a message to user that you can't see the content of this
folder, or something like this.

There is canRead() function in java api, but it always returns
true...

I also tried listFiles().length because it returns 0 for "/data"
folder.  But if i create a new folder in sdcard and click on it first
time then also listFiles().length will be 0 and user will see that you
can not see the containts of this folder.  I know i can check the path
of the folder and check that whether it's path starts with sdcard or
not and then do appropriate option.

But does anybody have tried anything which directly tells you that the
folder has files/folders in it but you don't have permissions.

thanks,
Payal

--~--~---------~--~----~------------~-------~--~----~

2. dotMobi TLD

Is the dotMobi TLD a sleeper or simply dead on arrival?

Does anyone in this forum believe in the viability of the .mobi
extension?

Thank you for contributing your thoughts regarding this perplexing
phenomenon.


-Datapimp

--~--~---------~--~----~------------~-------~--~----~

3. How to set up a new PC in one easy session

4. MediaPlayer.getFrameAt() is gone in V1.0. Alternatives in the meantime?

5. Hanging up outgoing calls.

6. replacing incoming call and outgoing call screens

7. World wide availablility of handsets before ADC II