Skip to content

Instantly share code, notes, and snippets.

@cthulhuplush
Created February 17, 2017 15:57
Show Gist options
  • Save cthulhuplush/7243f9221d8baf51caefe27f5df098e1 to your computer and use it in GitHub Desktop.
Save cthulhuplush/7243f9221d8baf51caefe27f5df098e1 to your computer and use it in GitHub Desktop.
public class MainActivity extends AppCompatActivity
{
private static final long MOVE_DEFAULT_TIME = 1000;
private static final long FADE_DEFAULT_TIME = 300;
private FragmentManager mFragmentManager;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ButterKnife.bind(this);
mFragmentManager = getSupportFragmentManager();
loadInitialFragment();
Handler handler = new Handler();
handler.postDelayed(this::performTransition, 1000);
}
private void loadInitialFragment()
{
Fragment initialFragment = Fragment1.newInstance();
FragmentTransaction fragmentTransaction = mFragmentManager.beginTransaction();
fragmentTransaction.replace(R.id.fragment_container, initialFragment);
fragmentTransaction.commit();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment