Ok I'll first try it short. Does anyone know how I insert this class
public class ResultBar extends FragmentActivity implements ActionBar.TabListener {
AppSectionsPagerAdapter mAppSectionsPagerAdapter;
ViewPager mViewPager;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.pagerlayout);
...
from the MainActivity into its ViewPager layout?
It is not possible to add one activity into another activity. Android use Fragments for this functionality. You can learn few things about them here or here.
So you can convert your
ResultBar
toFragment
, also converting yourMainActivity
toFragmentActivity
, its previous content toMainActivityContentFragment
and addResultBarFragment
to yourMainActivity
. This is how your main activity layour could look like:/res/layout/main_activity.xml:
Here also snippet how your ResultBarFragment could look like: