Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I found a way to my problem.</p> <p>Here we go</p> <p>First I used DialogFragment instead PopupView.</p> <p>So in my main activity I only created a Button who calls my DialogFragment.</p> <pre><code>public class Activity_principal1 extends FragmentActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_principal1); Button abrir = (Button) findViewById(R.id.botao); abrir.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { new DialogFragmentWindow().show(getSupportFragmentManager(), ""); } }); } }</code></pre> <p>My adapter still the same like the question.</p> <p>And here is where the magic occurs.</p> <pre><code>public class DialogFragmentWindow extends DialogFragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.popup, container); ViewPager vp_contentAcoesMusculares_SequenciaExercicios = (ViewPager) view.findViewById(R.id.vp_contentAcoesMusculares_SequenciaExercicios); List fragments = getFragments(); AcoesMuscularesAdapter ama = new AcoesMuscularesAdapter(getChildFragmentManager(), fragments); vp_contentAcoesMusculares_SequenciaExercicios.setAdapter(ama); getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE); return view; } private List getFragments(){ List fList = new ArrayList(); fList.add(FragmentAcoesMusculares.newInstance("Fragment 1",1)); fList.add(FragmentAcoesMusculares.newInstance("Fragment 2",2)); fList.add(FragmentAcoesMusculares.newInstance("Fragment 3",3)); return fList; } }</code></pre> <p>The difference is the getChildFragmentManager(). This little piece of code saved my day.</p> <p>The explanation to this is when I was using getSupportFragmentManager() and even indicating the viewpager was in another Layout XML he thought being in the main Layout XML.</p> <p>Now my app get the child fragment so now he see the ViewPager.</p> <p>That's it.</p> <p>Thanks everyone.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload