Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid Display and save data in next tab
    primarykey
    data
    text
    <p>I have created a <code>FragmentActivity</code> of 2 tabs. This is a very basic <code>Tab</code> example from Android Developer tutorial using <code>FragmentActivity</code> and <code>FragmentPagerAdapter</code> <a href="http://developer.android.com/reference/android/support/v4/app/FragmentPagerAdapter.html" rel="nofollow">Code Here</a></p> <pre><code> public class FragmentPagerSupport extends FragmentActivity implements ActionBar.TabListener { SectionsPagerAdapter mSectionsPagerAdapter; static final int NUM_ITEMS = 10; ViewPager mViewPager; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.fragment_pager); final ActionBar actionBar = getActionBar(); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); ........... } @Override public Fragment getItem(int position) { Fragment fragment = null; Bundle args = new Bundle(); switch (position) { case 0: fragment = new Fragment01(); args.putInt(Fragment01.ARG_SECTION_NUMBER, position + 1); fragment.setArguments(args); break; case 1: fragment = new Fragment02(); args.putInt(Fragment02.ARG_SECTION_NUMBER, position + 1); fragment.setArguments(args); break; return fragment; } } </code></pre> <p>Then I have created 2 different <code>fragments</code> for 2 <code>tabs</code>:</p> <pre><code>public static class Fragment01 extends Fragment { private EditText mName; private EditText mEmail1; public static final String ARG_SECTION_NUMBER = "2"; public Fragment01() { } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.activity_customer_add, container, false); mName = (EditText) v.findViewById(R.id.customer_add_name); mEmail = (EditText) v.findViewById(R.id.customer_add_email); View confirmButton = v.findViewById(R.id.customer_add_button); confirmButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { ...................... } }); } } </code></pre> <p>Now in the 2nd tab I need to show the input value of <code>Name</code> and <code>Email</code> from 1st tab and on confirm from 2nd tab need to save in <code>database</code>. But here I stuck. I am not getting an idea how I can keep data from <code>first tab</code>? Please help.</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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