Perguntas com a marcação «android-orientation»







2
Maneira infalível de lidar com o fragmento na mudança de orientação
public class MainActivity extends Activity implements MainMenuFragment.OnMainMenuItemSelectedListener { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); FragmentManager fragmentManager = getFragmentManager(); FragmentTransaction fragmentTransaction = fragmentManager .beginTransaction(); // add menu fragment MainMenuFragment myFragment = new MainMenuFragment(); fragmentTransaction.add(R.id.menu_fragment, myFragment); //add content DetailPart1 content1= new DetailPart1 (); fragmentTransaction.add(R.id.content_fragment, content1); fragmentTransaction.commit(); } public void onMainMenuSelected(String …
Ao utilizar nosso site, você reconhece que leu e compreendeu nossa Política de Cookies e nossa Política de Privacidade.
Licensed under cc by-sa 3.0 with attribution required.