Reputation: 9429
From my Activity I start an Intent (uploading a picture) and then I wait for result (onActivityResult).
How can I hide my Activity so it could handle the Intents result in a background? moveTaskToBack(true) hides the whole application, but I need just to get back to the previous Activity without finishing the current one.
Upvotes: 1
Views: 4489
Reputation: 663
If no view or element in the activity, you can have a try to set the activity as transparent in manifest:
android:theme="@android:style/Theme.Translucent"
Upvotes: 0
Reputation: 28086
As Android documentation explains, Activities are for displaying an interface to the user:
An activity represents a single screen with a user interface. For example, an email application might have one activity that shows a list of new emails, another activity to compose an email, and another activity for reading emails. Although the activities work together to form a cohesive user experience in the email application, each one is independent of the others. As such, a different application can start any one of these activities (if the email application allows it). For example, a camera application can start the activity in the email application that composes new mail, in order for the user to share a picture.
I recommend reading whole the article.
If you want to do something in background, you can use Thread
, AsyncTask
, or even a Service. Reading more from this documentation gives you more info about how these kind of things should be handled in Android.
Upvotes: 3
Reputation: 3029
I think, short answer is no. You can do it askew, but probably it's not a good interface design. Most likely the user will not happy when your Activity will popped up from background suddenly when he will doing something with te lower Activity.
Specify more precisely, what for do you want to use it. Perhaps there is another way.
Upvotes: 1