Tecnologia do Blogger.
RSS

Re: [androidbrasil-dev] Como navegar entre activies com unico Navigation Drawer?

Pq não usa uma activity com um drawer e usa fragments para as views?

Abraço,

Ernani

On Sun, Sep 21, 2014 at 5:31 PM, marcos filho <m.filhow@gmail.com> wrote:
> Possuo em torno de 3 activities que utilizam um mesmo Navigation Drawer em
> comum, queria saber a melhor forma de navegar entre elas é via startActivity
> mesmo, pois quando eu chamo o startactivity o menu do drawer é fechado de
> maneira muito brusca, como nunca trabalhei com esse drawer, queria a opnião
> de alguem.
>
> seque o código de como estou fazendo a chamada.
>
> private void selectItem(int position) {
> Log.i("NAVIGATION", "Acessando o navigation");
> position++;
> if(mCurrentSelectedPosition != position) {
> mCurrentSelectedPosition = position;
> if (mDrawerListView != null) {
> mDrawerListView.setItemChecked(position, true);
> }
> if (getmDrawerLayout() != null) {
> getmDrawerLayout().closeDrawer(mFragmentContainerView);
> }
> if (mCallbacks != null) {
> mCallbacks.onNavigationDrawerItemSelected(position);
> }
> } else {
> Crouton.makeText(getActivity(), "Você já está na tela
> selecionada", Style.INFO).show();
> }
> }
>
> @Override
> public void onNavigationDrawerItemSelected(int position) {
> switch (position) {
> case 1:
> startActivity(new Intent(this, DashboardActivity.class));
> break;
> default:
> // update the main content by replacing fragments
> FragmentManager fragmentManager = getSupportFragmentManager();
> fragmentManager.beginTransaction().replace(R.id.container,
> PlaceholderFragment.newInstance(position + 1)).commit();
> break;
> }
> }
>
> --
> 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.

--
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