Pedro Simão
Pedro Simão

Reputation: 293

android 2 activities on the same screen

I've a tabBar with 4 tabs, the Main tab is the first one, and when I click the second one I want do display another activity above the main activity in the half of the screen, reducing the opacity of the main. I'm doing this with a Dialog but it's not the result I want. What are the best way to do this?

example image

http://s9.postimg.org/e24pqpl3z/Untitled.jpg

Upvotes: 0

Views: 103

Answers (2)

Nathua
Nathua

Reputation: 8826

There are only 3 options to achieve what you want.

  • Second activity can be dialog (You already said you do it but you don't like).
  • Using fragments. (recommended)
  • Using layouts by playing with visibility, (not recommended in your case)

A Fragment represents a behavior or a portion of user interface in an Activity. You can combine multiple fragments in a single activity to build a multi-pane UI and reuse a fragment in multiple activities

Upvotes: 1

TMH
TMH

Reputation: 6246

Look at Fragments, this seems like the perfect time to use them.

Upvotes: 3

Related Questions