Tecnologia do Blogger.
RSS

Re: [androidbrasil-dev] Fragment e Activity

Olá Luciano.

Normalmente quando você tem um Navigation Drawer é comum que no seu layout vc tenha um FrameLayout onde você irá fazer o replace dos fragments. Displaying the navigation drawer.

Caso você queria usar somente fragmentos você pode fazer algo assim:

private void onItemBlogTabletSelected(int position){

Fragment fragment = null;
switch (position) {
case 0:
fragment = new BlogFragment();
break;

case 1:
fragment = new MainGalleryFragment();
break;

case 2:
fragment = new VideosFragment();
break;
       case 3:
           fragment = new QuestionsFragment();
break;
}

if (fragment != null) {
getSupportFragmentManager().beginTransaction()
.replace(R.id.container, fragment)
.commit();
}
}




Em 21 de maio de 2015 08:12, Luciano Pimenta <lucianoalmeidapimenta@gmail.com> escreveu:
Bom dia,
Uma dúvida que tenho em relação a correta distribuição/navegação de telas no Android.

Tenho um projeto Navigation Drawer. Acessando pelo menu, eu tenho um fragment, onde tem uma listagem.
Para editar um item dessa listagem eu devo chamar uma Activity ou usar outro Fragment?

Se for outro Fragment, como devo proceder?

Agradeço desde já a atenção.

Att

Luciano Pimenta

--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Rudson Lima ( live-O ) Desenvolvedor Android
Contato +55 85 87050560 - Fortaleza-ce
Social facebook | google+ | linkedin

--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

0 comentários:

Postar um comentário