Basically I want to do the opposite of this: run another activity (that I didn't write) over top of my own, and make that activity transparent. So it would be like running another app (whatever it might be), but with a custom background.
2 Answers
You cannot affect the background of another activity.
So unless the other activity that you didn't write is already transparent or provides some type of API for others to request it be made transparent (possible but not likely). There is really no way for you to achieve this.

- 46,603
- 18
- 125
- 156
-
There's no way to run another app inside your app? And to using OpenGL or something to blend with custom content? – Jason Jun 15 '12 at 18:39
-
Nope. Android apps are sandboxed so they can't affect other applications. Take a look [here](http://developer.android.com/guide/topics/security/security.html). – Jason L Jun 15 '12 at 18:43
-
nope not on stock Android. Something like that would probably require a heavily modified variant of the OS. As is, it was designed to keep all of the applications running completely separate from each other, for security purposes. – FoamyGuy Jun 15 '12 at 18:44
sorry for my bad english but i try my very best.
I need the other way around. I have an Activity and I call out of that a other App. But some times I have some Informations for the User. So I will blend a transparent Activity over the other App.
I still do. I made a Activity with transparent backgrount. When I call this Activity it will be opend. But not in front of the other App. My main Activity will be opend and in front of that the transparent Activity will start.
But I like to see my transparent Activity in front of the other App. Is this possible?
My code:
public class MsgDialog extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.msg_dialog);
}
}
This is the Activity no functionallity till now but this dosn't matter.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" android:background="@color/transparent ">
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
</LinearLayout>
The Layout only 2 Buttons but transparend background.
<activity android:name=".MsgDialog" android:theme="@style/Theme.Transparent"></activity>
The Manifest line for this Activity:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Transparent" parent="android:Theme">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:backgroundDimEnabled">true</item>
</style>
</resources>
My own Theme resource
So it works but only in front of my own App not in front of the foreign App. Any Idear to solve my Problem?
Thanks Oner

- 11
- 1