-4

I want to create different view states for error and success of login page. For that I want to create the singe activity (login), Which will have email and password fields. After submitting the data if I'm getting success/error then I want to display different layout (not in different activity). How can I achieve that ? Simpy.. I need to display multiple layouts on single activity on changing its states.

Galaxy Patel
  • 154
  • 7

1 Answers1

0

ok here simple one , say you want three layouts : creates 3 linearLayouts or Relative layouts for every states by default set their visibility to gone and give them ids find them by id (findViewByID) and than in every state use linearLayout1.setVisibility(View.VISIBLE); and the others

linearLayout2.setVisibility(View.GONE); linearLayout3.setVisibility(View.GONE); 

and so on with every new state

Kmelliti
  • 101
  • 7