Last active
December 27, 2015 21:29
-
-
Save KowalczykBartek/7391654 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
ze względu na to ze chce dla różnych orientacji inaczej wypełnić fragmenty, | |
muszę sprawdzić w jakiej aktualnie orientacji się znajduje. | |
*/ | |
if(getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE){ | |
PersonFragment articleFrag = (PersonFragment) | |
getSupportFragmentManager().findFragmentById(R.id.detail_container); | |
articleFrag.updateArticleView(person); | |
//Ląduje tutaj w przypadku kiedy aktualną orientacją jest landscape. | |
}else{ | |
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); | |
args.putSerializable("context", person); | |
newFragment.setArguments(args); | |
transaction.replace(R.id.fragment_container, newFragment); | |
ransaction.addToBackStack(null); | |
transaction.commit(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment