0

Given that there are activity a and b. a is my main activity, and b will be launched from a. I want b to be a non-fullscreen-sized activity, it will show up on top of a, and of course part of a would be still visible.

In practice, I created b with theme dialog, transparent background, but when it showed up, the entire screen except b itself was black and I can't see any part of activity a unless finished b. Looked like system forced b to occupy entire screen anyway.

Then how to create a real non-full-sized activity? thx.

This was how I created my own dialog theme

<style name="CustomDialogTheme" parent="android:Theme.Dialog">
    <item name="android:windowBackground">@android:color/transparent</item>
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowFullscreen">false</item>
</style>
fifth
  • 4,249
  • 9
  • 45
  • 62

3 Answers3

1

The theme you are extending has a property which dims the screen behind it, as well as other Dialog-ish type behavior... You probably need to override more behavior to get what you want,

http://developer.android.com/guide/topics/ui/themes.html

There's a link to the source and the style elements available to override in there somewhere... :)

Dan
  • 1,002
  • 12
  • 24
0

Did you try changing the layout_width and layout_height parameters for your primary Linear Layout>

Edunik
  • 26
  • 2
-1

Why not send a delayed message to the handler of the main activity? See http://developer.android.com/reference/android/os/Handler.html#sendMessageDelayed%28android.os.Message,%20long%29

The delay can be very minimal.

Vino
  • 1,544
  • 1
  • 18
  • 26