Reputation: 1721
I really need to understand the fragment issue.
What I just wanted to is putting my activity into a fragment or the same functionality into a fragment.
Is it possible?
I have ViewPager and fragments. And I want to display one activity in a fragment in a viewpager.
Upvotes: 2
Views: 102
Reputation: 171
I think you take the problem in the wrong way.
equivalent
" of your view.XML
with setContentView
. This xml
will
contains one or more Fragment.ActionBar
or anything you want.So first thing is to create a Fragment wich creates your view.
Copy/paste
your code relative to this UI
(textbox, onclick...) in your new fragment.
Then, add your fragment to your main XMl
.
It will works fine.
Moreover, for viewpager
you can find a lot of tutorial on internet, but you have to understand the difference between activities and fragments.
Hope it helps.
Upvotes: 1