How To Load An Activity In A fragment?

Loading activity in Fragment Code

  • Can we load an activity (specifically in onCreateView) in fragment ? Instead of creating view by inflater, can we launch activity so it's events gets called ? For e.g. Instead of using "inflater.inflate(R.layout.tabactivity, null)", can we launch activity which uses "tabactivity" as layout ?

  • Answer:

    Unfortunately this is not possible. You must create a Fragment Activity that will be used to refer to any fragment you create. This is a good place to start: https://github.com/bmeike/Fragments

Aniruddha at Stack Overflow Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.