Android getting the Fixed Tab, PageViewer to load different fragments
I'm new to software development and java as a whole, I've been trying for
days now to get the default template android gives for fixed tabbed
Navigation with pageviewer. Regardless of what I try I can't seem to get
it to load anything but the first fragment. all the other onClick tabs
events in the Emulator load the very same first fragment defined in the
template, sliding the pager has the same effect.
I've tried modifying my code several times till the point where there are
little runtime errors, but I still can't get it to load other fragments
through the Tabs.
I'd appreciate any help with this.
here's my code.
My projects a Native tablet EHR App
/**
* The {@link android.support.v4.view.PagerAdapter} that will provide
* fragments for each of the sections. We use a
* {@link android.support.v4.app.FragmentPagerAdapter} derivative, which
* will keep every loaded fragment in memory. If this becomes too memory
* intensive, it may be best to switch to a
* {@link android.support.v4.app.FragmentStatePagerAdapter}.
*/
package com.example.medictouch;
import java.util.Locale;
import com.example.medictouch.MedicTouchActivity.encountersFragment;
import
com.example.medictouch.MedicTouchActivity.patient_chartFragment;
import com.example.medictouch.MedicTouchActivity.billingFragment;
import com.example.medictouch.MedicTouchActivity.medicationsFragment;
import com.example.medictouch.MedicTouchActivity.treatmentsFragment;
import com.example.medictouch.MedicTouchActivity.laboratoryFragment;
import com.example.medictouch.MedicTouchActivity.imagingFragment;
import
com.example.medictouch.MedicTouchActivity.doctors_notesFragment;
import com.example.medictouch.MedicTouchActivity.departmentsFragment;
import android.app.ActionBar;
import android.app.FragmentTransaction;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.app.NavUtils;
import android.support.v4.view.ViewPager;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
public class MedicTouchActivity extends FragmentActivity implements
ActionBar.TabListener {
No comments:
Post a Comment