tags:

views:

79

answers:

2

Hi,

I have an NoContentViewActivity which has no Content View (i.e. I did not call setContentView() in the onCreate of my Activity). My question is how can I keep the content view of the launching activity on the screen? Right now, I am getting a blank screen whenever I launch NoContentViewActivity? I want the content view of the launching activity (the activity which start the NoContentViewActivity) to show on the screen.

Thank you for any help.

+1  A: 

It sounds like you'd be better off using a Service than an Activity. Activities are for code that is to be viewed; Services are for code that runs without a UI, which is what it sounds like you want.

Daniel Lew
A: 

An Activity with no Views assigned is an empty black screen, so it will still obscure the calling Activity. You could make your Activity transparent by assigning it a transparent theme:

android:theme="@style/Theme.Translucent"

Keep in mind though, that your invisible Activity will have focus, so the user won't be able to interact with the Activity underneath.

Why do you want to create a fully transparent Activity? As Daniel suggests, a Service might be a better solution to your problem if you genuinely don't want any user interaction.

Reto Meier