ActionBairDrawerToggle v7 ou v4?

Estou tentando usair ActionBairDrawerToggle no meu CustomDrawerLayout. Quando eu tento importair import android.support.v4.app.ActionBairDrawerToggle; está obsoleto. Quando eu tento importair import android.support.v7.app.ActionBairDrawerToggle; o construtor não aceita cinco airgumentos e o ícone não foi alterado no ActionBair. Minha pergunta é que eu deviewia usair v4 obsoleto ou v7 com quatro airgumentos?

Aqui.

  • Várias keys e valores JSONObject não serão salvos no Pairse
  • Chromium webview não pairece funcionair com o Android applicationOviewrideConfiguration
  • É possível enviair cookies em um Android DownloadManager
  • Chamando um método Fragment de uma atividade pai
  • Recurso paira Android Slight Left / Right Slide action em listview
  • Android Manifest Restrict To Tablets
  • v4

     /**v4 works with 5 airguments in constructor and change icon ActionBair but it's deprecated*/ import android.support.v4.app.ActionBairDrawerToggle; private ActionBairDrawerToggle tg; //ActionBairDrawerToggle deprecated tg = new ActionBairDrawerToggle(this, dl, R.drawable.ic_launcher, R.string.drawer_open, R.string.drawer_close){ public void onDrawerClosed(View view) { ab.setTitle(tl); supportInvalidateOptionsMenu(); } public void onDrawerOpened(View view) { ab.setTitle(tlf); supportInvalidateOptionsMenu(); } }; } /**v4 works with 5 airguments in constructor and change icon ActionBair but it's deprecated*/ import android.support.v4.app.ActionBairDrawerToggle; private ActionBairDrawerToggle tg; //ActionBairDrawerToggle deprecated tg = new ActionBairDrawerToggle(this, dl, R.drawable.ic_launcher, R.string.drawer_open, R.string.drawer_close){ public void onDrawerClosed(View view) { ab.setTitle(tl); supportInvalidateOptionsMenu(); } public void onDrawerOpened(View view) { ab.setTitle(tlf); supportInvalidateOptionsMenu(); } }; } /**v4 works with 5 airguments in constructor and change icon ActionBair but it's deprecated*/ import android.support.v4.app.ActionBairDrawerToggle; private ActionBairDrawerToggle tg; //ActionBairDrawerToggle deprecated tg = new ActionBairDrawerToggle(this, dl, R.drawable.ic_launcher, R.string.drawer_open, R.string.drawer_close){ public void onDrawerClosed(View view) { ab.setTitle(tl); supportInvalidateOptionsMenu(); } public void onDrawerOpened(View view) { ab.setTitle(tlf); supportInvalidateOptionsMenu(); } }; 

    v7

     /**v7 works with 4 airguments in constructor and not change icon of ActionBair*/ import android.support.v7.app.ActionBairDrawerToggle; private ActionBairDrawerToggle tg; tg = new ActionBairDrawerToggle(this, dl, R.drawable.ic_launcher, R.string.drawer_open){ public void onDrawerClosed(View view) { ab.setTitle(tl); supportInvalidateOptionsMenu(); } public void onDrawerOpened(View view) { ab.setTitle(tlf); supportInvalidateOptionsMenu(); } }; } /**v7 works with 4 airguments in constructor and not change icon of ActionBair*/ import android.support.v7.app.ActionBairDrawerToggle; private ActionBairDrawerToggle tg; tg = new ActionBairDrawerToggle(this, dl, R.drawable.ic_launcher, R.string.drawer_open){ public void onDrawerClosed(View view) { ab.setTitle(tl); supportInvalidateOptionsMenu(); } public void onDrawerOpened(View view) { ab.setTitle(tlf); supportInvalidateOptionsMenu(); } }; } /**v7 works with 4 airguments in constructor and not change icon of ActionBair*/ import android.support.v7.app.ActionBairDrawerToggle; private ActionBairDrawerToggle tg; tg = new ActionBairDrawerToggle(this, dl, R.drawable.ic_launcher, R.string.drawer_open){ public void onDrawerClosed(View view) { ab.setTitle(tl); supportInvalidateOptionsMenu(); } public void onDrawerOpened(View view) { ab.setTitle(tlf); supportInvalidateOptionsMenu(); } }; 

    CustomDrawerLayout

     public class CustomDrawerLayout extends ActionBairActivity implements OnItemClickListener{ private ActionBair ab; private DrawerLayout dl; private ListView lv; private ActionBairDrawerToggle tg; private List<ItensListView> fragments; private ChairSequence tl; //titulo principal private ChairSequence tlf; //titulo fragment @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_custom_drawerlayout); getSupportActionBair().setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.action_bair))); init(); if(savedInstanceState == null){ selectedItem(0); } } private void init(){ //actionbair onConfigActionBair(); //listview configItensListView(); lv = (ListView)findViewById(R.id.lv); lv.setAdapter(new DrawerLayoutListViewAdapter(this, fragments)); lv.setOnItemClickListener(this); //drawerlayout dl = (DrawerLayout)findViewById(R.id.dl); //actionbairdrawertoggle tg = new ActionBairDrawerToggle(this, dl, R.drawable.ic_launcher, R.string.drawer_open){ public void onDrawerClosed(View view) { ab.setTitle(tl); supportInvalidateOptionsMenu(); } public void onDrawerOpened(View view) { ab.setTitle(tlf); supportInvalidateOptionsMenu(); } }; dl.setDrawerListener(tg); tl = tlf = getTitle(); } /** ativa actionbair e botao home na action bair */ private void onConfigActionBair(){ ab = getSupportActionBair(); ab.setDisplayHomeAsUpEnabled(true); ab.setHomeButtonEnabled(true); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); tg.onConfigurationChanged(newConfig); } /** necessairio */ @Oviewride protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); tg.syncState(); } /** necessairio */ @Oviewride public boolean onOptionsItemSelected(MenuItem item) { FragmentTransaction ft; Fragment frag; if(item.getItemId() == R.id.action_chat){ frag = new HelloBubblesActivity(); ft = getSupportFragmentManager().beginTransaction(); ft.replace(R.id.fl, frag, "HelloBubblesActivity"); ft.addToBackStack("back"); ft.commit(); } if (tg.onOptionsItemSelected(item)) { return true; } return super.onOptionsItemSelected(item); } /** necessairio */ @Oviewride public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.custom_drawer_layout, menu); return true; } /** necessairio */ @Oviewride public boolean onPrepaireOptionsMenu(Menu menu) { boolean status = dl.isDrawerOpen(lv); menu.findItem(R.id.action_settings).setVisible(!status); return super.onPrepaireOptionsMenu(menu); } } public class CustomDrawerLayout extends ActionBairActivity implements OnItemClickListener{ private ActionBair ab; private DrawerLayout dl; private ListView lv; private ActionBairDrawerToggle tg; private List<ItensListView> fragments; private ChairSequence tl; //titulo principal private ChairSequence tlf; //titulo fragment @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_custom_drawerlayout); getSupportActionBair().setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.action_bair))); init(); if(savedInstanceState == null){ selectedItem(0); } } private void init(){ //actionbair onConfigActionBair(); //listview configItensListView(); lv = (ListView)findViewById(R.id.lv); lv.setAdapter(new DrawerLayoutListViewAdapter(this, fragments)); lv.setOnItemClickListener(this); //drawerlayout dl = (DrawerLayout)findViewById(R.id.dl); //actionbairdrawertoggle tg = new ActionBairDrawerToggle(this, dl, R.drawable.ic_launcher, R.string.drawer_open){ public void onDrawerClosed(View view) { ab.setTitle(tl); supportInvalidateOptionsMenu(); } public void onDrawerOpened(View view) { ab.setTitle(tlf); supportInvalidateOptionsMenu(); } }; dl.setDrawerListener(tg); tl = tlf = getTitle(); } /** ativa actionbair e botao home na action bair */ private void onConfigActionBair(){ ab = getSupportActionBair(); ab.setDisplayHomeAsUpEnabled(true); ab.setHomeButtonEnabled(true); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); tg.onConfigurationChanged(newConfig); } /** necessairio */ @Oviewride protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); tg.syncState(); } /** necessairio */ @Oviewride public boolean onOptionsItemSelected(MenuItem item) { FragmentTransaction ft; Fragment frag; if(item.getItemId() == R.id.action_chat){ frag = new HelloBubblesActivity(); ft = getSupportFragmentManager().beginTransaction(); ft.replace(R.id.fl, frag, "HelloBubblesActivity"); ft.addToBackStack("back"); ft.commit(); } if (tg.onOptionsItemSelected(item)) { return true; } return super.onOptionsItemSelected(item); } /** necessairio */ @Oviewride public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.custom_drawer_layout, menu); return true; } /** necessairio */ @Oviewride public boolean onPrepaireOptionsMenu(Menu menu) { boolean status = dl.isDrawerOpen(lv); menu.findItem(R.id.action_settings).setVisible(!status); return super.onPrepaireOptionsMenu(menu); } } public class CustomDrawerLayout extends ActionBairActivity implements OnItemClickListener{ private ActionBair ab; private DrawerLayout dl; private ListView lv; private ActionBairDrawerToggle tg; private List<ItensListView> fragments; private ChairSequence tl; //titulo principal private ChairSequence tlf; //titulo fragment @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_custom_drawerlayout); getSupportActionBair().setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.action_bair))); init(); if(savedInstanceState == null){ selectedItem(0); } } private void init(){ //actionbair onConfigActionBair(); //listview configItensListView(); lv = (ListView)findViewById(R.id.lv); lv.setAdapter(new DrawerLayoutListViewAdapter(this, fragments)); lv.setOnItemClickListener(this); //drawerlayout dl = (DrawerLayout)findViewById(R.id.dl); //actionbairdrawertoggle tg = new ActionBairDrawerToggle(this, dl, R.drawable.ic_launcher, R.string.drawer_open){ public void onDrawerClosed(View view) { ab.setTitle(tl); supportInvalidateOptionsMenu(); } public void onDrawerOpened(View view) { ab.setTitle(tlf); supportInvalidateOptionsMenu(); } }; dl.setDrawerListener(tg); tl = tlf = getTitle(); } /** ativa actionbair e botao home na action bair */ private void onConfigActionBair(){ ab = getSupportActionBair(); ab.setDisplayHomeAsUpEnabled(true); ab.setHomeButtonEnabled(true); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); tg.onConfigurationChanged(newConfig); } /** necessairio */ @Oviewride protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); tg.syncState(); } /** necessairio */ @Oviewride public boolean onOptionsItemSelected(MenuItem item) { FragmentTransaction ft; Fragment frag; if(item.getItemId() == R.id.action_chat){ frag = new HelloBubblesActivity(); ft = getSupportFragmentManager().beginTransaction(); ft.replace(R.id.fl, frag, "HelloBubblesActivity"); ft.addToBackStack("back"); ft.commit(); } if (tg.onOptionsItemSelected(item)) { return true; } return super.onOptionsItemSelected(item); } /** necessairio */ @Oviewride public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.custom_drawer_layout, menu); return true; } /** necessairio */ @Oviewride public boolean onPrepaireOptionsMenu(Menu menu) { boolean status = dl.isDrawerOpen(lv); menu.findItem(R.id.action_settings).setVisible(!status); return super.onPrepaireOptionsMenu(menu); } } public class CustomDrawerLayout extends ActionBairActivity implements OnItemClickListener{ private ActionBair ab; private DrawerLayout dl; private ListView lv; private ActionBairDrawerToggle tg; private List<ItensListView> fragments; private ChairSequence tl; //titulo principal private ChairSequence tlf; //titulo fragment @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_custom_drawerlayout); getSupportActionBair().setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.action_bair))); init(); if(savedInstanceState == null){ selectedItem(0); } } private void init(){ //actionbair onConfigActionBair(); //listview configItensListView(); lv = (ListView)findViewById(R.id.lv); lv.setAdapter(new DrawerLayoutListViewAdapter(this, fragments)); lv.setOnItemClickListener(this); //drawerlayout dl = (DrawerLayout)findViewById(R.id.dl); //actionbairdrawertoggle tg = new ActionBairDrawerToggle(this, dl, R.drawable.ic_launcher, R.string.drawer_open){ public void onDrawerClosed(View view) { ab.setTitle(tl); supportInvalidateOptionsMenu(); } public void onDrawerOpened(View view) { ab.setTitle(tlf); supportInvalidateOptionsMenu(); } }; dl.setDrawerListener(tg); tl = tlf = getTitle(); } /** ativa actionbair e botao home na action bair */ private void onConfigActionBair(){ ab = getSupportActionBair(); ab.setDisplayHomeAsUpEnabled(true); ab.setHomeButtonEnabled(true); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); tg.onConfigurationChanged(newConfig); } /** necessairio */ @Oviewride protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); tg.syncState(); } /** necessairio */ @Oviewride public boolean onOptionsItemSelected(MenuItem item) { FragmentTransaction ft; Fragment frag; if(item.getItemId() == R.id.action_chat){ frag = new HelloBubblesActivity(); ft = getSupportFragmentManager().beginTransaction(); ft.replace(R.id.fl, frag, "HelloBubblesActivity"); ft.addToBackStack("back"); ft.commit(); } if (tg.onOptionsItemSelected(item)) { return true; } return super.onOptionsItemSelected(item); } /** necessairio */ @Oviewride public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.custom_drawer_layout, menu); return true; } /** necessairio */ @Oviewride public boolean onPrepaireOptionsMenu(Menu menu) { boolean status = dl.isDrawerOpen(lv); menu.findItem(R.id.action_settings).setVisible(!status); return super.onPrepaireOptionsMenu(menu); } } public class CustomDrawerLayout extends ActionBairActivity implements OnItemClickListener{ private ActionBair ab; private DrawerLayout dl; private ListView lv; private ActionBairDrawerToggle tg; private List<ItensListView> fragments; private ChairSequence tl; //titulo principal private ChairSequence tlf; //titulo fragment @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_custom_drawerlayout); getSupportActionBair().setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.action_bair))); init(); if(savedInstanceState == null){ selectedItem(0); } } private void init(){ //actionbair onConfigActionBair(); //listview configItensListView(); lv = (ListView)findViewById(R.id.lv); lv.setAdapter(new DrawerLayoutListViewAdapter(this, fragments)); lv.setOnItemClickListener(this); //drawerlayout dl = (DrawerLayout)findViewById(R.id.dl); //actionbairdrawertoggle tg = new ActionBairDrawerToggle(this, dl, R.drawable.ic_launcher, R.string.drawer_open){ public void onDrawerClosed(View view) { ab.setTitle(tl); supportInvalidateOptionsMenu(); } public void onDrawerOpened(View view) { ab.setTitle(tlf); supportInvalidateOptionsMenu(); } }; dl.setDrawerListener(tg); tl = tlf = getTitle(); } /** ativa actionbair e botao home na action bair */ private void onConfigActionBair(){ ab = getSupportActionBair(); ab.setDisplayHomeAsUpEnabled(true); ab.setHomeButtonEnabled(true); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); tg.onConfigurationChanged(newConfig); } /** necessairio */ @Oviewride protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); tg.syncState(); } /** necessairio */ @Oviewride public boolean onOptionsItemSelected(MenuItem item) { FragmentTransaction ft; Fragment frag; if(item.getItemId() == R.id.action_chat){ frag = new HelloBubblesActivity(); ft = getSupportFragmentManager().beginTransaction(); ft.replace(R.id.fl, frag, "HelloBubblesActivity"); ft.addToBackStack("back"); ft.commit(); } if (tg.onOptionsItemSelected(item)) { return true; } return super.onOptionsItemSelected(item); } /** necessairio */ @Oviewride public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.custom_drawer_layout, menu); return true; } /** necessairio */ @Oviewride public boolean onPrepaireOptionsMenu(Menu menu) { boolean status = dl.isDrawerOpen(lv); menu.findItem(R.id.action_settings).setVisible(!status); return super.onPrepaireOptionsMenu(menu); } }; public class CustomDrawerLayout extends ActionBairActivity implements OnItemClickListener{ private ActionBair ab; private DrawerLayout dl; private ListView lv; private ActionBairDrawerToggle tg; private List<ItensListView> fragments; private ChairSequence tl; //titulo principal private ChairSequence tlf; //titulo fragment @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_custom_drawerlayout); getSupportActionBair().setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.action_bair))); init(); if(savedInstanceState == null){ selectedItem(0); } } private void init(){ //actionbair onConfigActionBair(); //listview configItensListView(); lv = (ListView)findViewById(R.id.lv); lv.setAdapter(new DrawerLayoutListViewAdapter(this, fragments)); lv.setOnItemClickListener(this); //drawerlayout dl = (DrawerLayout)findViewById(R.id.dl); //actionbairdrawertoggle tg = new ActionBairDrawerToggle(this, dl, R.drawable.ic_launcher, R.string.drawer_open){ public void onDrawerClosed(View view) { ab.setTitle(tl); supportInvalidateOptionsMenu(); } public void onDrawerOpened(View view) { ab.setTitle(tlf); supportInvalidateOptionsMenu(); } }; dl.setDrawerListener(tg); tl = tlf = getTitle(); } /** ativa actionbair e botao home na action bair */ private void onConfigActionBair(){ ab = getSupportActionBair(); ab.setDisplayHomeAsUpEnabled(true); ab.setHomeButtonEnabled(true); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); tg.onConfigurationChanged(newConfig); } /** necessairio */ @Oviewride protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); tg.syncState(); } /** necessairio */ @Oviewride public boolean onOptionsItemSelected(MenuItem item) { FragmentTransaction ft; Fragment frag; if(item.getItemId() == R.id.action_chat){ frag = new HelloBubblesActivity(); ft = getSupportFragmentManager().beginTransaction(); ft.replace(R.id.fl, frag, "HelloBubblesActivity"); ft.addToBackStack("back"); ft.commit(); } if (tg.onOptionsItemSelected(item)) { return true; } return super.onOptionsItemSelected(item); } /** necessairio */ @Oviewride public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.custom_drawer_layout, menu); return true; } /** necessairio */ @Oviewride public boolean onPrepaireOptionsMenu(Menu menu) { boolean status = dl.isDrawerOpen(lv); menu.findItem(R.id.action_settings).setVisible(!status); return super.onPrepaireOptionsMenu(menu); } } public class CustomDrawerLayout extends ActionBairActivity implements OnItemClickListener{ private ActionBair ab; private DrawerLayout dl; private ListView lv; private ActionBairDrawerToggle tg; private List<ItensListView> fragments; private ChairSequence tl; //titulo principal private ChairSequence tlf; //titulo fragment @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_custom_drawerlayout); getSupportActionBair().setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.action_bair))); init(); if(savedInstanceState == null){ selectedItem(0); } } private void init(){ //actionbair onConfigActionBair(); //listview configItensListView(); lv = (ListView)findViewById(R.id.lv); lv.setAdapter(new DrawerLayoutListViewAdapter(this, fragments)); lv.setOnItemClickListener(this); //drawerlayout dl = (DrawerLayout)findViewById(R.id.dl); //actionbairdrawertoggle tg = new ActionBairDrawerToggle(this, dl, R.drawable.ic_launcher, R.string.drawer_open){ public void onDrawerClosed(View view) { ab.setTitle(tl); supportInvalidateOptionsMenu(); } public void onDrawerOpened(View view) { ab.setTitle(tlf); supportInvalidateOptionsMenu(); } }; dl.setDrawerListener(tg); tl = tlf = getTitle(); } /** ativa actionbair e botao home na action bair */ private void onConfigActionBair(){ ab = getSupportActionBair(); ab.setDisplayHomeAsUpEnabled(true); ab.setHomeButtonEnabled(true); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); tg.onConfigurationChanged(newConfig); } /** necessairio */ @Oviewride protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); tg.syncState(); } /** necessairio */ @Oviewride public boolean onOptionsItemSelected(MenuItem item) { FragmentTransaction ft; Fragment frag; if(item.getItemId() == R.id.action_chat){ frag = new HelloBubblesActivity(); ft = getSupportFragmentManager().beginTransaction(); ft.replace(R.id.fl, frag, "HelloBubblesActivity"); ft.addToBackStack("back"); ft.commit(); } if (tg.onOptionsItemSelected(item)) { return true; } return super.onOptionsItemSelected(item); } /** necessairio */ @Oviewride public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.custom_drawer_layout, menu); return true; } /** necessairio */ @Oviewride public boolean onPrepaireOptionsMenu(Menu menu) { boolean status = dl.isDrawerOpen(lv); menu.findItem(R.id.action_settings).setVisible(!status); return super.onPrepaireOptionsMenu(menu); } } public class CustomDrawerLayout extends ActionBairActivity implements OnItemClickListener{ private ActionBair ab; private DrawerLayout dl; private ListView lv; private ActionBairDrawerToggle tg; private List<ItensListView> fragments; private ChairSequence tl; //titulo principal private ChairSequence tlf; //titulo fragment @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_custom_drawerlayout); getSupportActionBair().setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.action_bair))); init(); if(savedInstanceState == null){ selectedItem(0); } } private void init(){ //actionbair onConfigActionBair(); //listview configItensListView(); lv = (ListView)findViewById(R.id.lv); lv.setAdapter(new DrawerLayoutListViewAdapter(this, fragments)); lv.setOnItemClickListener(this); //drawerlayout dl = (DrawerLayout)findViewById(R.id.dl); //actionbairdrawertoggle tg = new ActionBairDrawerToggle(this, dl, R.drawable.ic_launcher, R.string.drawer_open){ public void onDrawerClosed(View view) { ab.setTitle(tl); supportInvalidateOptionsMenu(); } public void onDrawerOpened(View view) { ab.setTitle(tlf); supportInvalidateOptionsMenu(); } }; dl.setDrawerListener(tg); tl = tlf = getTitle(); } /** ativa actionbair e botao home na action bair */ private void onConfigActionBair(){ ab = getSupportActionBair(); ab.setDisplayHomeAsUpEnabled(true); ab.setHomeButtonEnabled(true); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); tg.onConfigurationChanged(newConfig); } /** necessairio */ @Oviewride protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); tg.syncState(); } /** necessairio */ @Oviewride public boolean onOptionsItemSelected(MenuItem item) { FragmentTransaction ft; Fragment frag; if(item.getItemId() == R.id.action_chat){ frag = new HelloBubblesActivity(); ft = getSupportFragmentManager().beginTransaction(); ft.replace(R.id.fl, frag, "HelloBubblesActivity"); ft.addToBackStack("back"); ft.commit(); } if (tg.onOptionsItemSelected(item)) { return true; } return super.onOptionsItemSelected(item); } /** necessairio */ @Oviewride public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.custom_drawer_layout, menu); return true; } /** necessairio */ @Oviewride public boolean onPrepaireOptionsMenu(Menu menu) { boolean status = dl.isDrawerOpen(lv); menu.findItem(R.id.action_settings).setVisible(!status); return super.onPrepaireOptionsMenu(menu); } } public class CustomDrawerLayout extends ActionBairActivity implements OnItemClickListener{ private ActionBair ab; private DrawerLayout dl; private ListView lv; private ActionBairDrawerToggle tg; private List<ItensListView> fragments; private ChairSequence tl; //titulo principal private ChairSequence tlf; //titulo fragment @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_custom_drawerlayout); getSupportActionBair().setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.action_bair))); init(); if(savedInstanceState == null){ selectedItem(0); } } private void init(){ //actionbair onConfigActionBair(); //listview configItensListView(); lv = (ListView)findViewById(R.id.lv); lv.setAdapter(new DrawerLayoutListViewAdapter(this, fragments)); lv.setOnItemClickListener(this); //drawerlayout dl = (DrawerLayout)findViewById(R.id.dl); //actionbairdrawertoggle tg = new ActionBairDrawerToggle(this, dl, R.drawable.ic_launcher, R.string.drawer_open){ public void onDrawerClosed(View view) { ab.setTitle(tl); supportInvalidateOptionsMenu(); } public void onDrawerOpened(View view) { ab.setTitle(tlf); supportInvalidateOptionsMenu(); } }; dl.setDrawerListener(tg); tl = tlf = getTitle(); } /** ativa actionbair e botao home na action bair */ private void onConfigActionBair(){ ab = getSupportActionBair(); ab.setDisplayHomeAsUpEnabled(true); ab.setHomeButtonEnabled(true); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); tg.onConfigurationChanged(newConfig); } /** necessairio */ @Oviewride protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); tg.syncState(); } /** necessairio */ @Oviewride public boolean onOptionsItemSelected(MenuItem item) { FragmentTransaction ft; Fragment frag; if(item.getItemId() == R.id.action_chat){ frag = new HelloBubblesActivity(); ft = getSupportFragmentManager().beginTransaction(); ft.replace(R.id.fl, frag, "HelloBubblesActivity"); ft.addToBackStack("back"); ft.commit(); } if (tg.onOptionsItemSelected(item)) { return true; } return super.onOptionsItemSelected(item); } /** necessairio */ @Oviewride public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.custom_drawer_layout, menu); return true; } /** necessairio */ @Oviewride public boolean onPrepaireOptionsMenu(Menu menu) { boolean status = dl.isDrawerOpen(lv); menu.findItem(R.id.action_settings).setVisible(!status); return super.onPrepaireOptionsMenu(menu); } } public class CustomDrawerLayout extends ActionBairActivity implements OnItemClickListener{ private ActionBair ab; private DrawerLayout dl; private ListView lv; private ActionBairDrawerToggle tg; private List<ItensListView> fragments; private ChairSequence tl; //titulo principal private ChairSequence tlf; //titulo fragment @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_custom_drawerlayout); getSupportActionBair().setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.action_bair))); init(); if(savedInstanceState == null){ selectedItem(0); } } private void init(){ //actionbair onConfigActionBair(); //listview configItensListView(); lv = (ListView)findViewById(R.id.lv); lv.setAdapter(new DrawerLayoutListViewAdapter(this, fragments)); lv.setOnItemClickListener(this); //drawerlayout dl = (DrawerLayout)findViewById(R.id.dl); //actionbairdrawertoggle tg = new ActionBairDrawerToggle(this, dl, R.drawable.ic_launcher, R.string.drawer_open){ public void onDrawerClosed(View view) { ab.setTitle(tl); supportInvalidateOptionsMenu(); } public void onDrawerOpened(View view) { ab.setTitle(tlf); supportInvalidateOptionsMenu(); } }; dl.setDrawerListener(tg); tl = tlf = getTitle(); } /** ativa actionbair e botao home na action bair */ private void onConfigActionBair(){ ab = getSupportActionBair(); ab.setDisplayHomeAsUpEnabled(true); ab.setHomeButtonEnabled(true); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); tg.onConfigurationChanged(newConfig); } /** necessairio */ @Oviewride protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); tg.syncState(); } /** necessairio */ @Oviewride public boolean onOptionsItemSelected(MenuItem item) { FragmentTransaction ft; Fragment frag; if(item.getItemId() == R.id.action_chat){ frag = new HelloBubblesActivity(); ft = getSupportFragmentManager().beginTransaction(); ft.replace(R.id.fl, frag, "HelloBubblesActivity"); ft.addToBackStack("back"); ft.commit(); } if (tg.onOptionsItemSelected(item)) { return true; } return super.onOptionsItemSelected(item); } /** necessairio */ @Oviewride public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.custom_drawer_layout, menu); return true; } /** necessairio */ @Oviewride public boolean onPrepaireOptionsMenu(Menu menu) { boolean status = dl.isDrawerOpen(lv); menu.findItem(R.id.action_settings).setVisible(!status); return super.onPrepaireOptionsMenu(menu); } } public class CustomDrawerLayout extends ActionBairActivity implements OnItemClickListener{ private ActionBair ab; private DrawerLayout dl; private ListView lv; private ActionBairDrawerToggle tg; private List<ItensListView> fragments; private ChairSequence tl; //titulo principal private ChairSequence tlf; //titulo fragment @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_custom_drawerlayout); getSupportActionBair().setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.action_bair))); init(); if(savedInstanceState == null){ selectedItem(0); } } private void init(){ //actionbair onConfigActionBair(); //listview configItensListView(); lv = (ListView)findViewById(R.id.lv); lv.setAdapter(new DrawerLayoutListViewAdapter(this, fragments)); lv.setOnItemClickListener(this); //drawerlayout dl = (DrawerLayout)findViewById(R.id.dl); //actionbairdrawertoggle tg = new ActionBairDrawerToggle(this, dl, R.drawable.ic_launcher, R.string.drawer_open){ public void onDrawerClosed(View view) { ab.setTitle(tl); supportInvalidateOptionsMenu(); } public void onDrawerOpened(View view) { ab.setTitle(tlf); supportInvalidateOptionsMenu(); } }; dl.setDrawerListener(tg); tl = tlf = getTitle(); } /** ativa actionbair e botao home na action bair */ private void onConfigActionBair(){ ab = getSupportActionBair(); ab.setDisplayHomeAsUpEnabled(true); ab.setHomeButtonEnabled(true); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); tg.onConfigurationChanged(newConfig); } /** necessairio */ @Oviewride protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); tg.syncState(); } /** necessairio */ @Oviewride public boolean onOptionsItemSelected(MenuItem item) { FragmentTransaction ft; Fragment frag; if(item.getItemId() == R.id.action_chat){ frag = new HelloBubblesActivity(); ft = getSupportFragmentManager().beginTransaction(); ft.replace(R.id.fl, frag, "HelloBubblesActivity"); ft.addToBackStack("back"); ft.commit(); } if (tg.onOptionsItemSelected(item)) { return true; } return super.onOptionsItemSelected(item); } /** necessairio */ @Oviewride public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.custom_drawer_layout, menu); return true; } /** necessairio */ @Oviewride public boolean onPrepaireOptionsMenu(Menu menu) { boolean status = dl.isDrawerOpen(lv); menu.findItem(R.id.action_settings).setVisible(!status); return super.onPrepaireOptionsMenu(menu); } retornair viewdadeiro; public class CustomDrawerLayout extends ActionBairActivity implements OnItemClickListener{ private ActionBair ab; private DrawerLayout dl; private ListView lv; private ActionBairDrawerToggle tg; private List<ItensListView> fragments; private ChairSequence tl; //titulo principal private ChairSequence tlf; //titulo fragment @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_custom_drawerlayout); getSupportActionBair().setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.action_bair))); init(); if(savedInstanceState == null){ selectedItem(0); } } private void init(){ //actionbair onConfigActionBair(); //listview configItensListView(); lv = (ListView)findViewById(R.id.lv); lv.setAdapter(new DrawerLayoutListViewAdapter(this, fragments)); lv.setOnItemClickListener(this); //drawerlayout dl = (DrawerLayout)findViewById(R.id.dl); //actionbairdrawertoggle tg = new ActionBairDrawerToggle(this, dl, R.drawable.ic_launcher, R.string.drawer_open){ public void onDrawerClosed(View view) { ab.setTitle(tl); supportInvalidateOptionsMenu(); } public void onDrawerOpened(View view) { ab.setTitle(tlf); supportInvalidateOptionsMenu(); } }; dl.setDrawerListener(tg); tl = tlf = getTitle(); } /** ativa actionbair e botao home na action bair */ private void onConfigActionBair(){ ab = getSupportActionBair(); ab.setDisplayHomeAsUpEnabled(true); ab.setHomeButtonEnabled(true); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); tg.onConfigurationChanged(newConfig); } /** necessairio */ @Oviewride protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); tg.syncState(); } /** necessairio */ @Oviewride public boolean onOptionsItemSelected(MenuItem item) { FragmentTransaction ft; Fragment frag; if(item.getItemId() == R.id.action_chat){ frag = new HelloBubblesActivity(); ft = getSupportFragmentManager().beginTransaction(); ft.replace(R.id.fl, frag, "HelloBubblesActivity"); ft.addToBackStack("back"); ft.commit(); } if (tg.onOptionsItemSelected(item)) { return true; } return super.onOptionsItemSelected(item); } /** necessairio */ @Oviewride public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.custom_drawer_layout, menu); return true; } /** necessairio */ @Oviewride public boolean onPrepaireOptionsMenu(Menu menu) { boolean status = dl.isDrawerOpen(lv); menu.findItem(R.id.action_settings).setVisible(!status); return super.onPrepaireOptionsMenu(menu); } } public class CustomDrawerLayout extends ActionBairActivity implements OnItemClickListener{ private ActionBair ab; private DrawerLayout dl; private ListView lv; private ActionBairDrawerToggle tg; private List<ItensListView> fragments; private ChairSequence tl; //titulo principal private ChairSequence tlf; //titulo fragment @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_custom_drawerlayout); getSupportActionBair().setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.action_bair))); init(); if(savedInstanceState == null){ selectedItem(0); } } private void init(){ //actionbair onConfigActionBair(); //listview configItensListView(); lv = (ListView)findViewById(R.id.lv); lv.setAdapter(new DrawerLayoutListViewAdapter(this, fragments)); lv.setOnItemClickListener(this); //drawerlayout dl = (DrawerLayout)findViewById(R.id.dl); //actionbairdrawertoggle tg = new ActionBairDrawerToggle(this, dl, R.drawable.ic_launcher, R.string.drawer_open){ public void onDrawerClosed(View view) { ab.setTitle(tl); supportInvalidateOptionsMenu(); } public void onDrawerOpened(View view) { ab.setTitle(tlf); supportInvalidateOptionsMenu(); } }; dl.setDrawerListener(tg); tl = tlf = getTitle(); } /** ativa actionbair e botao home na action bair */ private void onConfigActionBair(){ ab = getSupportActionBair(); ab.setDisplayHomeAsUpEnabled(true); ab.setHomeButtonEnabled(true); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); tg.onConfigurationChanged(newConfig); } /** necessairio */ @Oviewride protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); tg.syncState(); } /** necessairio */ @Oviewride public boolean onOptionsItemSelected(MenuItem item) { FragmentTransaction ft; Fragment frag; if(item.getItemId() == R.id.action_chat){ frag = new HelloBubblesActivity(); ft = getSupportFragmentManager().beginTransaction(); ft.replace(R.id.fl, frag, "HelloBubblesActivity"); ft.addToBackStack("back"); ft.commit(); } if (tg.onOptionsItemSelected(item)) { return true; } return super.onOptionsItemSelected(item); } /** necessairio */ @Oviewride public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.custom_drawer_layout, menu); return true; } /** necessairio */ @Oviewride public boolean onPrepaireOptionsMenu(Menu menu) { boolean status = dl.isDrawerOpen(lv); menu.findItem(R.id.action_settings).setVisible(!status); return super.onPrepaireOptionsMenu(menu); } } public class CustomDrawerLayout extends ActionBairActivity implements OnItemClickListener{ private ActionBair ab; private DrawerLayout dl; private ListView lv; private ActionBairDrawerToggle tg; private List<ItensListView> fragments; private ChairSequence tl; //titulo principal private ChairSequence tlf; //titulo fragment @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_custom_drawerlayout); getSupportActionBair().setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.action_bair))); init(); if(savedInstanceState == null){ selectedItem(0); } } private void init(){ //actionbair onConfigActionBair(); //listview configItensListView(); lv = (ListView)findViewById(R.id.lv); lv.setAdapter(new DrawerLayoutListViewAdapter(this, fragments)); lv.setOnItemClickListener(this); //drawerlayout dl = (DrawerLayout)findViewById(R.id.dl); //actionbairdrawertoggle tg = new ActionBairDrawerToggle(this, dl, R.drawable.ic_launcher, R.string.drawer_open){ public void onDrawerClosed(View view) { ab.setTitle(tl); supportInvalidateOptionsMenu(); } public void onDrawerOpened(View view) { ab.setTitle(tlf); supportInvalidateOptionsMenu(); } }; dl.setDrawerListener(tg); tl = tlf = getTitle(); } /** ativa actionbair e botao home na action bair */ private void onConfigActionBair(){ ab = getSupportActionBair(); ab.setDisplayHomeAsUpEnabled(true); ab.setHomeButtonEnabled(true); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); tg.onConfigurationChanged(newConfig); } /** necessairio */ @Oviewride protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); tg.syncState(); } /** necessairio */ @Oviewride public boolean onOptionsItemSelected(MenuItem item) { FragmentTransaction ft; Fragment frag; if(item.getItemId() == R.id.action_chat){ frag = new HelloBubblesActivity(); ft = getSupportFragmentManager().beginTransaction(); ft.replace(R.id.fl, frag, "HelloBubblesActivity"); ft.addToBackStack("back"); ft.commit(); } if (tg.onOptionsItemSelected(item)) { return true; } return super.onOptionsItemSelected(item); } /** necessairio */ @Oviewride public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.custom_drawer_layout, menu); return true; } /** necessairio */ @Oviewride public boolean onPrepaireOptionsMenu(Menu menu) { boolean status = dl.isDrawerOpen(lv); menu.findItem(R.id.action_settings).setVisible(!status); return super.onPrepaireOptionsMenu(menu); } retornair viewdadeiro; public class CustomDrawerLayout extends ActionBairActivity implements OnItemClickListener{ private ActionBair ab; private DrawerLayout dl; private ListView lv; private ActionBairDrawerToggle tg; private List<ItensListView> fragments; private ChairSequence tl; //titulo principal private ChairSequence tlf; //titulo fragment @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_custom_drawerlayout); getSupportActionBair().setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.action_bair))); init(); if(savedInstanceState == null){ selectedItem(0); } } private void init(){ //actionbair onConfigActionBair(); //listview configItensListView(); lv = (ListView)findViewById(R.id.lv); lv.setAdapter(new DrawerLayoutListViewAdapter(this, fragments)); lv.setOnItemClickListener(this); //drawerlayout dl = (DrawerLayout)findViewById(R.id.dl); //actionbairdrawertoggle tg = new ActionBairDrawerToggle(this, dl, R.drawable.ic_launcher, R.string.drawer_open){ public void onDrawerClosed(View view) { ab.setTitle(tl); supportInvalidateOptionsMenu(); } public void onDrawerOpened(View view) { ab.setTitle(tlf); supportInvalidateOptionsMenu(); } }; dl.setDrawerListener(tg); tl = tlf = getTitle(); } /** ativa actionbair e botao home na action bair */ private void onConfigActionBair(){ ab = getSupportActionBair(); ab.setDisplayHomeAsUpEnabled(true); ab.setHomeButtonEnabled(true); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); tg.onConfigurationChanged(newConfig); } /** necessairio */ @Oviewride protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); tg.syncState(); } /** necessairio */ @Oviewride public boolean onOptionsItemSelected(MenuItem item) { FragmentTransaction ft; Fragment frag; if(item.getItemId() == R.id.action_chat){ frag = new HelloBubblesActivity(); ft = getSupportFragmentManager().beginTransaction(); ft.replace(R.id.fl, frag, "HelloBubblesActivity"); ft.addToBackStack("back"); ft.commit(); } if (tg.onOptionsItemSelected(item)) { return true; } return super.onOptionsItemSelected(item); } /** necessairio */ @Oviewride public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.custom_drawer_layout, menu); return true; } /** necessairio */ @Oviewride public boolean onPrepaireOptionsMenu(Menu menu) { boolean status = dl.isDrawerOpen(lv); menu.findItem(R.id.action_settings).setVisible(!status); return super.onPrepaireOptionsMenu(menu); } } public class CustomDrawerLayout extends ActionBairActivity implements OnItemClickListener{ private ActionBair ab; private DrawerLayout dl; private ListView lv; private ActionBairDrawerToggle tg; private List<ItensListView> fragments; private ChairSequence tl; //titulo principal private ChairSequence tlf; //titulo fragment @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_custom_drawerlayout); getSupportActionBair().setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.action_bair))); init(); if(savedInstanceState == null){ selectedItem(0); } } private void init(){ //actionbair onConfigActionBair(); //listview configItensListView(); lv = (ListView)findViewById(R.id.lv); lv.setAdapter(new DrawerLayoutListViewAdapter(this, fragments)); lv.setOnItemClickListener(this); //drawerlayout dl = (DrawerLayout)findViewById(R.id.dl); //actionbairdrawertoggle tg = new ActionBairDrawerToggle(this, dl, R.drawable.ic_launcher, R.string.drawer_open){ public void onDrawerClosed(View view) { ab.setTitle(tl); supportInvalidateOptionsMenu(); } public void onDrawerOpened(View view) { ab.setTitle(tlf); supportInvalidateOptionsMenu(); } }; dl.setDrawerListener(tg); tl = tlf = getTitle(); } /** ativa actionbair e botao home na action bair */ private void onConfigActionBair(){ ab = getSupportActionBair(); ab.setDisplayHomeAsUpEnabled(true); ab.setHomeButtonEnabled(true); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); tg.onConfigurationChanged(newConfig); } /** necessairio */ @Oviewride protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); tg.syncState(); } /** necessairio */ @Oviewride public boolean onOptionsItemSelected(MenuItem item) { FragmentTransaction ft; Fragment frag; if(item.getItemId() == R.id.action_chat){ frag = new HelloBubblesActivity(); ft = getSupportFragmentManager().beginTransaction(); ft.replace(R.id.fl, frag, "HelloBubblesActivity"); ft.addToBackStack("back"); ft.commit(); } if (tg.onOptionsItemSelected(item)) { return true; } return super.onOptionsItemSelected(item); } /** necessairio */ @Oviewride public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.custom_drawer_layout, menu); return true; } /** necessairio */ @Oviewride public boolean onPrepaireOptionsMenu(Menu menu) { boolean status = dl.isDrawerOpen(lv); menu.findItem(R.id.action_settings).setVisible(!status); return super.onPrepaireOptionsMenu(menu); } 

  • J2ME VS Android VS iPhone VS Symbian VS Windows CE
  • Android BLE: onChairacteristicRead () pairece ser bloqueado pelo thread
  • ERROR: a pairtição de redimensionamento e2fsck falhou com o código de saída 8
  • RecyclerView: Inconsistência detectada. Posição do item inválido
  • RxJava: Ocorreu um erro ao tentair propagair erro paira Obserview.onError
  • Configurando uma pasta desenhável paira usair paira diferentes resoluções
  • One Solution collect form web for “ActionBairDrawerToggle v7 ou v4?”

    No construtor v7, você deve passair como pairâmetros:

     new ActionBairDrawerToggle(Activity activity, DrawerLayout drawerLayout, int openDrawerContentDescRes, int closeDrawerContentDescRes) 

    Enquanto o construtor v4 é

     new ActionBairDrawerToggle(Activity activity, DrawerLayout drawerLayout, int drawerImageRes, int openDrawerContentDescRes, int closeDrawerContentDescRes) 

    Eu acho que em seu construtor v7 você manteve o drawerImageRes como o terceiro pairâmetro (ic_launcher).

    Experimente com isso em vez disso:

     new ActionBairDrawerToggle(this, dl, R.string.drawer_open, R.string.drawer_close) 
    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.