Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Have you tried <a href="http://developer.android.com/reference/android/app/FragmentManager.html#findFragmentByTag%28java.lang.String%29" rel="nofollow noreferrer"><code>FragmentManager.findFragmentByTag()</code></a></p> <pre><code>FragmentManager manager = getSupportedFragmentManager(); //with support package, else //FragmentManager manager = getFragmentManager() Fragment fragment = manager.findFragmentByTag("Tag You Created the Fragment"); if (fragment instanceof Fragment1){ Fragment1 fr = (Fragment1)fragment fr.updateData(DATA) //or any method of your choice } </code></pre> <p><strong>EDIT:</strong> I read carefully! The <code>instanceOf</code> will cast a <code>Fragment</code> into your Fragment class. It was you, who suggested <code>Fragment1</code> as a name for simpicity. Also, you didn't provide any source to help us. It is true, that you cannot set a <code>Fragment</code>'s tag, but why do you think you are able to get its tag? Usually a <code>Fragment</code> is added through <code>FragmentManagers</code> like </p> <pre><code>FragmentManager manager = getSupportedFragmnentManager() FragmentTransaction transaction = manager.beginTransaction(); transaction.add(int containerViewId, Fragment fragment, String tag); // or transaction.add(Fragment fragment, String tag) // ...other transactions transaction.commit() </code></pre> <p><strong>EDIT2:</strong> it's very easy though. according to your code you could just call</p> <pre><code>Fragment fragment = mAdapter.getItem(0) // 0||1||2 </code></pre> <p>You should consider reading the docs (i.e about <a href="http://developer.android.com/reference/android/support/v4/app/FragmentPagerAdapter.html#getItem%28int%29" rel="nofollow noreferrer">FragmenPagerAdapter</a>) and post your source code so we don't have to guess what you need.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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