我想在一个使用TabLayout的Activity中实现一个ListFragment,这样我就可以在不同的列表之间滑动.最后它应该成为一个预订应用程序,以便您可以选择不同的学科,并预订一个特定的时间段.然而到目前为止,我只实现了ListActivity或标签活动(android studio中的标准活动),但不是两者.如果有人可以提供帮助,我会很高兴的.标签式活动:
public class Diciplines extends AppCompatActivity {
/**
* The {@link android.support.v4.view.PagerAdapter} that will provide
* fragments for each of the sections. We use a
* {@link 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}.
*/
private SectionsPagerAdapter mSectionsPagerAdapter;
/**
* The {@link ViewPager} that will host the section contents.
*/
private ViewPager mViewPager;
@Override
protected void onCreate(Bundle …Run Code Online (Sandbox Code Playgroud)