如何从活动中启动特定的Tablayout片段

时间:2018-07-09 13:18:13

标签: java android

此登录名是片段,我想从此活动中启动它。我该怎么办?

Log_In log_in =new Log_In();
android.support.v4.app.FragmentTransaction transaction= getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.relative_layout,log_in);
transaction.commit();
finish();
viewPager.setCurrentItem(1);

1 个答案:

答案 0 :(得分:0)

Log_In log_in =new Log_In();
FragmentTransaction fTransaction=getFragmentManager();
mTransaction.beginTransaction()
.replace(R.layout.container,log_in)  
.commit();