Skip to content

Instantly share code, notes, and snippets.

@manishkpr
Created December 30, 2016 09:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manishkpr/6d6c3c9ebca5ccafaa72cc898014d5b6 to your computer and use it in GitHub Desktop.
Save manishkpr/6d6c3c9ebca5ccafaa72cc898014d5b6 to your computer and use it in GitHub Desktop.
public class MainActivity extends FragmentActivity{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setUpView();
setUpFragment();
}
void setUpView(){
setContentView(R.layout.activity_main);
}
void setUpFragment(){
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
SlidingFragment fragment = new SlidingFragment();
transaction.replace(R.id.sample_content_fragment, fragment);
transaction.commit();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment