prak
prak

Reputation: 31

Start two Activities simultaneously

Is it possible to start an activity in the background? That is, instead of showing it in the front, I want it to start in the background and want it running "under" another Activity.

Is this possible?

Upvotes: 3

Views: 1026

Answers (2)

Aashish Bhatnagar
Aashish Bhatnagar

Reputation: 2605

You can't start two activities simultaneously but what you can do is start the activity that you want in background 1st and inside the onCreate method of that activity call the foreground activity in such a way you can have desired activity at top and another one in background ready to be brought to foreground when required.

Your mainActivity---->open Activity1(supposed to be in background)-->Activity2(Activity2 comes FG while Activity1 goes in BG).

Upvotes: 0

Bear
Bear

Reputation: 5152

Are you looking for Service ?

Activity is supposed to be run in foreground while Service is supposed to be run in background

There can be only one top Actvity!

Upvotes: 2

Related Questions