androidandroid-studioandroid-layoutandroid-studio-4.1

Handling multiple resource layouts using one java class


Is it possible to handle two or more resource layouts using one java class in android development? I want to create a multi-page signup page with one java class itself.


Solution

  • Simple Solution: Use Fragment under a Frame Layout in your main class.

    Alter Solution: Use View Visibility GONE/VISIBLE to Load many views in one activity

    Alter Solution: You Can Load Previous View data locally and load new content view by simply calling setContentView(R.layout."new layout");