Pregunta

i am creating an application using tabhost. I use this tab host in FRAGMENTACTIVITY. under each tab i open Fragments.

But my requirement is

FragmentActivity contains a tabHost. and tab structure as given below.

Tab1 fragment1.1 (on click) Fragment1.2

Tab2 Fragment2.1

Tab3 Fragment3.1

i created mainActivity(FRAGMENTACTIVITY) using this tutorial

http://thepseudocoder.wordpress.com/2011/10/04/android-tabs-the-fragment-way/

but i didn't get any idea to open another fragment under 1st tab.

¿Fue útil?

Solución

FragmentManager fragmentManager = getSupportFragmentManager();
    FragmentTransaction fragmentTransaction = fragmentManager
            .beginTransaction();
    fragment1.2 fragment = new fragment1.2();
    fragmentTransaction.add(R.id.tabcontent, fragment);
    fragmentTransaction.commit();
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top