user1265623
user1265623

Reputation: 95

Call different layouts based on function call

I have 2 functions send and receive. I need to display send and receive message. I have to display a.xml if it is send function and b.xml if it is received function. How can i set the flag. Please guide me how to call layouts based on function call.

Thanks.

Upvotes: 0

Views: 138

Answers (1)

Ted Hopp
Ted Hopp

Reputation: 234797

You can call setContentView(R.layout.a) or setContentView(R.layout.b) to change the view hierarchy displayed by the activity. These can be called multiple times during an activity's life.

Upvotes: 1

Related Questions