Sometimes it is necessary to have the activity run in the background in the following ways:
In Androidmanifest.xml, the activity attribute is increased:
Android:theme= "@style/backgroundonly"
Android:configchanges= "Orientation|keyboardhidden"
Add the following as follows:
<activity android:name= "Activityname"
Android:label= "@string/app_name"
Android:theme= "@style/backgroundonly"
android:configchanges= "Orientation|keyboardhidden" >
Style.xml content is as follows:
<resources>
<style name= "Backgroundonly" >
<item name= "Android:windowbackground" > @null </item>
<item name= "Android:windowcontentoverlay" > @null </item>
<item name= "Android:windowanimationstyle" > @null </item>
<item name= "Android:windownotitle" >true</item>
<!--<item name= "Android:windownodisplay" >true</item>
--><item name= "Android:windowisfloating" >true</item>
</style>
</resources>
In this way, the activity runs in the background and ends with finish () when you're done with your task.
Android for activity background run