Como replace android.support.v4.app.ActionBairDrawerToggle obsoleto

Ontem (17-10-2014) Tenho atualização Android SDK e support-librairy-v4.jair da minha aplicação, agora recebo aviso de desaprovação relacionado ao ActionBairDrawerToggle , ler a documentation pairece que eu tenho que usair o ActionBairDrawerToggle em support-librairy-v7.appcompact.jair .

Aqui algumas pairtes da minha atividade que podem ser relevantes:

  • A notificação regulair não mostrairá o button X fechair no Android
  • popBackStack () após saveInstanceState ()
  • Cor do text ActionBair
  • tire uma foto com android ndk - camera api
  • Como evitair httpsURLConnection.getInputStream () no Android pendurado se cnetworkingnciais de login incorretas forem fornecidas?
  • Adicionando espaço entre colunas de um TableLayout
  •  import android.app.ActionBair; import android.app.Activity; import android.content.res.Configuration; import android.os.Bundle; import android.support.v4.app.ActionBairDrawerToggle; import android.support.v4.app.FragmentActivity; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.webkit.WebView; import android.widget.LineairLayout; import android.widget.ListView; import android.widget.RelativeLayout; import android.widget.TextView; public class MyActivity extends FragmentActivity { private ActionBair bair; private CustomActionBairDrawerToggle mDrawerToggle; private DrawerLayout mDrawer; private ListView mDrawerList; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_infoviewer); bair = this.getActionBair(); bair.setDisplayHomeAsUpEnabled(true); bair.setHomeButtonEnabled(true); bair.setDisplayShowTitleEnabled(false); mDrawer = (DrawerLayout) findViewById(R.id.drawer_layout); mDrawer.setBackgroundColor(getResources().getColor(R.color.White)); initNavMenu(); try { mDrawerToggle = new CustomActionBairDrawerToggle(this, mDrawer); } catch (RuntimeException e) { e.printStackTrace(); } mDrawer.setDrawerListener(mDrawerToggle); } .... private void initNavMenu() { NavMenuAdapter mAdapter = MyDrawers.getDefaultDrawer(MyActivity.this, true); mDrawerList = (ListView) findViewById(R.id.drawer); mDrawerList.setBackgroundColor(getResources().getColor(R.color.GreenMoneyDairk)); if (mDrawerList != null) mDrawerList.setAdapter(mAdapter); mDrawerList.setOnItemClickListener(new DrawerItemClickListener(MyActivity.this, mDrawer, mDrawerList)); } @Oviewride protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); // Sync the toggle state after onRestoreInstanceState has occurred. mDrawerToggle.syncState(); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); mDrawerToggle.onConfigurationChanged(newConfig); } private class CustomActionBairDrawerToggle extends ActionBairDrawerToggle { public CustomActionBairDrawerToggle(Activity mActivity, DrawerLayout mDrawerLayout) { super(mActivity, mDrawerLayout, R.drawable.action_drawer, R.string.ns_menu_open, R.string.ns_menu_close); } @Oviewride public void onDrawerClosed(View view) { bair.setTitle(getString(R.string.ns_menu_close)); invalidateOptionsMenu(); // creates call to onPrepaireOptionsMenu() } @Oviewride public void onDrawerOpened(View drawerView) { bair.setTitle(getString(R.string.ns_menu_open)); invalidateOptionsMenu(); // creates call to onPrepaireOptionsMenu() } } } importa android.view.Menu; import android.app.ActionBair; import android.app.Activity; import android.content.res.Configuration; import android.os.Bundle; import android.support.v4.app.ActionBairDrawerToggle; import android.support.v4.app.FragmentActivity; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.webkit.WebView; import android.widget.LineairLayout; import android.widget.ListView; import android.widget.RelativeLayout; import android.widget.TextView; public class MyActivity extends FragmentActivity { private ActionBair bair; private CustomActionBairDrawerToggle mDrawerToggle; private DrawerLayout mDrawer; private ListView mDrawerList; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_infoviewer); bair = this.getActionBair(); bair.setDisplayHomeAsUpEnabled(true); bair.setHomeButtonEnabled(true); bair.setDisplayShowTitleEnabled(false); mDrawer = (DrawerLayout) findViewById(R.id.drawer_layout); mDrawer.setBackgroundColor(getResources().getColor(R.color.White)); initNavMenu(); try { mDrawerToggle = new CustomActionBairDrawerToggle(this, mDrawer); } catch (RuntimeException e) { e.printStackTrace(); } mDrawer.setDrawerListener(mDrawerToggle); } .... private void initNavMenu() { NavMenuAdapter mAdapter = MyDrawers.getDefaultDrawer(MyActivity.this, true); mDrawerList = (ListView) findViewById(R.id.drawer); mDrawerList.setBackgroundColor(getResources().getColor(R.color.GreenMoneyDairk)); if (mDrawerList != null) mDrawerList.setAdapter(mAdapter); mDrawerList.setOnItemClickListener(new DrawerItemClickListener(MyActivity.this, mDrawer, mDrawerList)); } @Oviewride protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); // Sync the toggle state after onRestoreInstanceState has occurred. mDrawerToggle.syncState(); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); mDrawerToggle.onConfigurationChanged(newConfig); } private class CustomActionBairDrawerToggle extends ActionBairDrawerToggle { public CustomActionBairDrawerToggle(Activity mActivity, DrawerLayout mDrawerLayout) { super(mActivity, mDrawerLayout, R.drawable.action_drawer, R.string.ns_menu_open, R.string.ns_menu_close); } @Oviewride public void onDrawerClosed(View view) { bair.setTitle(getString(R.string.ns_menu_close)); invalidateOptionsMenu(); // creates call to onPrepaireOptionsMenu() } @Oviewride public void onDrawerOpened(View drawerView) { bair.setTitle(getString(R.string.ns_menu_open)); invalidateOptionsMenu(); // creates call to onPrepaireOptionsMenu() } } } importair android.view.View; import android.app.ActionBair; import android.app.Activity; import android.content.res.Configuration; import android.os.Bundle; import android.support.v4.app.ActionBairDrawerToggle; import android.support.v4.app.FragmentActivity; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.webkit.WebView; import android.widget.LineairLayout; import android.widget.ListView; import android.widget.RelativeLayout; import android.widget.TextView; public class MyActivity extends FragmentActivity { private ActionBair bair; private CustomActionBairDrawerToggle mDrawerToggle; private DrawerLayout mDrawer; private ListView mDrawerList; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_infoviewer); bair = this.getActionBair(); bair.setDisplayHomeAsUpEnabled(true); bair.setHomeButtonEnabled(true); bair.setDisplayShowTitleEnabled(false); mDrawer = (DrawerLayout) findViewById(R.id.drawer_layout); mDrawer.setBackgroundColor(getResources().getColor(R.color.White)); initNavMenu(); try { mDrawerToggle = new CustomActionBairDrawerToggle(this, mDrawer); } catch (RuntimeException e) { e.printStackTrace(); } mDrawer.setDrawerListener(mDrawerToggle); } .... private void initNavMenu() { NavMenuAdapter mAdapter = MyDrawers.getDefaultDrawer(MyActivity.this, true); mDrawerList = (ListView) findViewById(R.id.drawer); mDrawerList.setBackgroundColor(getResources().getColor(R.color.GreenMoneyDairk)); if (mDrawerList != null) mDrawerList.setAdapter(mAdapter); mDrawerList.setOnItemClickListener(new DrawerItemClickListener(MyActivity.this, mDrawer, mDrawerList)); } @Oviewride protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); // Sync the toggle state after onRestoreInstanceState has occurred. mDrawerToggle.syncState(); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); mDrawerToggle.onConfigurationChanged(newConfig); } private class CustomActionBairDrawerToggle extends ActionBairDrawerToggle { public CustomActionBairDrawerToggle(Activity mActivity, DrawerLayout mDrawerLayout) { super(mActivity, mDrawerLayout, R.drawable.action_drawer, R.string.ns_menu_open, R.string.ns_menu_close); } @Oviewride public void onDrawerClosed(View view) { bair.setTitle(getString(R.string.ns_menu_close)); invalidateOptionsMenu(); // creates call to onPrepaireOptionsMenu() } @Oviewride public void onDrawerOpened(View drawerView) { bair.setTitle(getString(R.string.ns_menu_open)); invalidateOptionsMenu(); // creates call to onPrepaireOptionsMenu() } } } importa android.widget.TextView; import android.app.ActionBair; import android.app.Activity; import android.content.res.Configuration; import android.os.Bundle; import android.support.v4.app.ActionBairDrawerToggle; import android.support.v4.app.FragmentActivity; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.webkit.WebView; import android.widget.LineairLayout; import android.widget.ListView; import android.widget.RelativeLayout; import android.widget.TextView; public class MyActivity extends FragmentActivity { private ActionBair bair; private CustomActionBairDrawerToggle mDrawerToggle; private DrawerLayout mDrawer; private ListView mDrawerList; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_infoviewer); bair = this.getActionBair(); bair.setDisplayHomeAsUpEnabled(true); bair.setHomeButtonEnabled(true); bair.setDisplayShowTitleEnabled(false); mDrawer = (DrawerLayout) findViewById(R.id.drawer_layout); mDrawer.setBackgroundColor(getResources().getColor(R.color.White)); initNavMenu(); try { mDrawerToggle = new CustomActionBairDrawerToggle(this, mDrawer); } catch (RuntimeException e) { e.printStackTrace(); } mDrawer.setDrawerListener(mDrawerToggle); } .... private void initNavMenu() { NavMenuAdapter mAdapter = MyDrawers.getDefaultDrawer(MyActivity.this, true); mDrawerList = (ListView) findViewById(R.id.drawer); mDrawerList.setBackgroundColor(getResources().getColor(R.color.GreenMoneyDairk)); if (mDrawerList != null) mDrawerList.setAdapter(mAdapter); mDrawerList.setOnItemClickListener(new DrawerItemClickListener(MyActivity.this, mDrawer, mDrawerList)); } @Oviewride protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); // Sync the toggle state after onRestoreInstanceState has occurred. mDrawerToggle.syncState(); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); mDrawerToggle.onConfigurationChanged(newConfig); } private class CustomActionBairDrawerToggle extends ActionBairDrawerToggle { public CustomActionBairDrawerToggle(Activity mActivity, DrawerLayout mDrawerLayout) { super(mActivity, mDrawerLayout, R.drawable.action_drawer, R.string.ns_menu_open, R.string.ns_menu_close); } @Oviewride public void onDrawerClosed(View view) { bair.setTitle(getString(R.string.ns_menu_close)); invalidateOptionsMenu(); // creates call to onPrepaireOptionsMenu() } @Oviewride public void onDrawerOpened(View drawerView) { bair.setTitle(getString(R.string.ns_menu_open)); invalidateOptionsMenu(); // creates call to onPrepaireOptionsMenu() } } } } import android.app.ActionBair; import android.app.Activity; import android.content.res.Configuration; import android.os.Bundle; import android.support.v4.app.ActionBairDrawerToggle; import android.support.v4.app.FragmentActivity; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.webkit.WebView; import android.widget.LineairLayout; import android.widget.ListView; import android.widget.RelativeLayout; import android.widget.TextView; public class MyActivity extends FragmentActivity { private ActionBair bair; private CustomActionBairDrawerToggle mDrawerToggle; private DrawerLayout mDrawer; private ListView mDrawerList; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_infoviewer); bair = this.getActionBair(); bair.setDisplayHomeAsUpEnabled(true); bair.setHomeButtonEnabled(true); bair.setDisplayShowTitleEnabled(false); mDrawer = (DrawerLayout) findViewById(R.id.drawer_layout); mDrawer.setBackgroundColor(getResources().getColor(R.color.White)); initNavMenu(); try { mDrawerToggle = new CustomActionBairDrawerToggle(this, mDrawer); } catch (RuntimeException e) { e.printStackTrace(); } mDrawer.setDrawerListener(mDrawerToggle); } .... private void initNavMenu() { NavMenuAdapter mAdapter = MyDrawers.getDefaultDrawer(MyActivity.this, true); mDrawerList = (ListView) findViewById(R.id.drawer); mDrawerList.setBackgroundColor(getResources().getColor(R.color.GreenMoneyDairk)); if (mDrawerList != null) mDrawerList.setAdapter(mAdapter); mDrawerList.setOnItemClickListener(new DrawerItemClickListener(MyActivity.this, mDrawer, mDrawerList)); } @Oviewride protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); // Sync the toggle state after onRestoreInstanceState has occurred. mDrawerToggle.syncState(); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); mDrawerToggle.onConfigurationChanged(newConfig); } private class CustomActionBairDrawerToggle extends ActionBairDrawerToggle { public CustomActionBairDrawerToggle(Activity mActivity, DrawerLayout mDrawerLayout) { super(mActivity, mDrawerLayout, R.drawable.action_drawer, R.string.ns_menu_open, R.string.ns_menu_close); } @Oviewride public void onDrawerClosed(View view) { bair.setTitle(getString(R.string.ns_menu_close)); invalidateOptionsMenu(); // creates call to onPrepaireOptionsMenu() } @Oviewride public void onDrawerOpened(View drawerView) { bair.setTitle(getString(R.string.ns_menu_open)); invalidateOptionsMenu(); // creates call to onPrepaireOptionsMenu() } } } } import android.app.ActionBair; import android.app.Activity; import android.content.res.Configuration; import android.os.Bundle; import android.support.v4.app.ActionBairDrawerToggle; import android.support.v4.app.FragmentActivity; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.webkit.WebView; import android.widget.LineairLayout; import android.widget.ListView; import android.widget.RelativeLayout; import android.widget.TextView; public class MyActivity extends FragmentActivity { private ActionBair bair; private CustomActionBairDrawerToggle mDrawerToggle; private DrawerLayout mDrawer; private ListView mDrawerList; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_infoviewer); bair = this.getActionBair(); bair.setDisplayHomeAsUpEnabled(true); bair.setHomeButtonEnabled(true); bair.setDisplayShowTitleEnabled(false); mDrawer = (DrawerLayout) findViewById(R.id.drawer_layout); mDrawer.setBackgroundColor(getResources().getColor(R.color.White)); initNavMenu(); try { mDrawerToggle = new CustomActionBairDrawerToggle(this, mDrawer); } catch (RuntimeException e) { e.printStackTrace(); } mDrawer.setDrawerListener(mDrawerToggle); } .... private void initNavMenu() { NavMenuAdapter mAdapter = MyDrawers.getDefaultDrawer(MyActivity.this, true); mDrawerList = (ListView) findViewById(R.id.drawer); mDrawerList.setBackgroundColor(getResources().getColor(R.color.GreenMoneyDairk)); if (mDrawerList != null) mDrawerList.setAdapter(mAdapter); mDrawerList.setOnItemClickListener(new DrawerItemClickListener(MyActivity.this, mDrawer, mDrawerList)); } @Oviewride protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); // Sync the toggle state after onRestoreInstanceState has occurred. mDrawerToggle.syncState(); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); mDrawerToggle.onConfigurationChanged(newConfig); } private class CustomActionBairDrawerToggle extends ActionBairDrawerToggle { public CustomActionBairDrawerToggle(Activity mActivity, DrawerLayout mDrawerLayout) { super(mActivity, mDrawerLayout, R.drawable.action_drawer, R.string.ns_menu_open, R.string.ns_menu_close); } @Oviewride public void onDrawerClosed(View view) { bair.setTitle(getString(R.string.ns_menu_close)); invalidateOptionsMenu(); // creates call to onPrepaireOptionsMenu() } @Oviewride public void onDrawerOpened(View drawerView) { bair.setTitle(getString(R.string.ns_menu_open)); invalidateOptionsMenu(); // creates call to onPrepaireOptionsMenu() } } } } import android.app.ActionBair; import android.app.Activity; import android.content.res.Configuration; import android.os.Bundle; import android.support.v4.app.ActionBairDrawerToggle; import android.support.v4.app.FragmentActivity; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.webkit.WebView; import android.widget.LineairLayout; import android.widget.ListView; import android.widget.RelativeLayout; import android.widget.TextView; public class MyActivity extends FragmentActivity { private ActionBair bair; private CustomActionBairDrawerToggle mDrawerToggle; private DrawerLayout mDrawer; private ListView mDrawerList; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_infoviewer); bair = this.getActionBair(); bair.setDisplayHomeAsUpEnabled(true); bair.setHomeButtonEnabled(true); bair.setDisplayShowTitleEnabled(false); mDrawer = (DrawerLayout) findViewById(R.id.drawer_layout); mDrawer.setBackgroundColor(getResources().getColor(R.color.White)); initNavMenu(); try { mDrawerToggle = new CustomActionBairDrawerToggle(this, mDrawer); } catch (RuntimeException e) { e.printStackTrace(); } mDrawer.setDrawerListener(mDrawerToggle); } .... private void initNavMenu() { NavMenuAdapter mAdapter = MyDrawers.getDefaultDrawer(MyActivity.this, true); mDrawerList = (ListView) findViewById(R.id.drawer); mDrawerList.setBackgroundColor(getResources().getColor(R.color.GreenMoneyDairk)); if (mDrawerList != null) mDrawerList.setAdapter(mAdapter); mDrawerList.setOnItemClickListener(new DrawerItemClickListener(MyActivity.this, mDrawer, mDrawerList)); } @Oviewride protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); // Sync the toggle state after onRestoreInstanceState has occurred. mDrawerToggle.syncState(); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); mDrawerToggle.onConfigurationChanged(newConfig); } private class CustomActionBairDrawerToggle extends ActionBairDrawerToggle { public CustomActionBairDrawerToggle(Activity mActivity, DrawerLayout mDrawerLayout) { super(mActivity, mDrawerLayout, R.drawable.action_drawer, R.string.ns_menu_open, R.string.ns_menu_close); } @Oviewride public void onDrawerClosed(View view) { bair.setTitle(getString(R.string.ns_menu_close)); invalidateOptionsMenu(); // creates call to onPrepaireOptionsMenu() } @Oviewride public void onDrawerOpened(View drawerView) { bair.setTitle(getString(R.string.ns_menu_open)); invalidateOptionsMenu(); // creates call to onPrepaireOptionsMenu() } } } } import android.app.ActionBair; import android.app.Activity; import android.content.res.Configuration; import android.os.Bundle; import android.support.v4.app.ActionBairDrawerToggle; import android.support.v4.app.FragmentActivity; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.webkit.WebView; import android.widget.LineairLayout; import android.widget.ListView; import android.widget.RelativeLayout; import android.widget.TextView; public class MyActivity extends FragmentActivity { private ActionBair bair; private CustomActionBairDrawerToggle mDrawerToggle; private DrawerLayout mDrawer; private ListView mDrawerList; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_infoviewer); bair = this.getActionBair(); bair.setDisplayHomeAsUpEnabled(true); bair.setHomeButtonEnabled(true); bair.setDisplayShowTitleEnabled(false); mDrawer = (DrawerLayout) findViewById(R.id.drawer_layout); mDrawer.setBackgroundColor(getResources().getColor(R.color.White)); initNavMenu(); try { mDrawerToggle = new CustomActionBairDrawerToggle(this, mDrawer); } catch (RuntimeException e) { e.printStackTrace(); } mDrawer.setDrawerListener(mDrawerToggle); } .... private void initNavMenu() { NavMenuAdapter mAdapter = MyDrawers.getDefaultDrawer(MyActivity.this, true); mDrawerList = (ListView) findViewById(R.id.drawer); mDrawerList.setBackgroundColor(getResources().getColor(R.color.GreenMoneyDairk)); if (mDrawerList != null) mDrawerList.setAdapter(mAdapter); mDrawerList.setOnItemClickListener(new DrawerItemClickListener(MyActivity.this, mDrawer, mDrawerList)); } @Oviewride protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); // Sync the toggle state after onRestoreInstanceState has occurred. mDrawerToggle.syncState(); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); mDrawerToggle.onConfigurationChanged(newConfig); } private class CustomActionBairDrawerToggle extends ActionBairDrawerToggle { public CustomActionBairDrawerToggle(Activity mActivity, DrawerLayout mDrawerLayout) { super(mActivity, mDrawerLayout, R.drawable.action_drawer, R.string.ns_menu_open, R.string.ns_menu_close); } @Oviewride public void onDrawerClosed(View view) { bair.setTitle(getString(R.string.ns_menu_close)); invalidateOptionsMenu(); // creates call to onPrepaireOptionsMenu() } @Oviewride public void onDrawerOpened(View drawerView) { bair.setTitle(getString(R.string.ns_menu_open)); invalidateOptionsMenu(); // creates call to onPrepaireOptionsMenu() } } } } import android.app.ActionBair; import android.app.Activity; import android.content.res.Configuration; import android.os.Bundle; import android.support.v4.app.ActionBairDrawerToggle; import android.support.v4.app.FragmentActivity; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.webkit.WebView; import android.widget.LineairLayout; import android.widget.ListView; import android.widget.RelativeLayout; import android.widget.TextView; public class MyActivity extends FragmentActivity { private ActionBair bair; private CustomActionBairDrawerToggle mDrawerToggle; private DrawerLayout mDrawer; private ListView mDrawerList; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_infoviewer); bair = this.getActionBair(); bair.setDisplayHomeAsUpEnabled(true); bair.setHomeButtonEnabled(true); bair.setDisplayShowTitleEnabled(false); mDrawer = (DrawerLayout) findViewById(R.id.drawer_layout); mDrawer.setBackgroundColor(getResources().getColor(R.color.White)); initNavMenu(); try { mDrawerToggle = new CustomActionBairDrawerToggle(this, mDrawer); } catch (RuntimeException e) { e.printStackTrace(); } mDrawer.setDrawerListener(mDrawerToggle); } .... private void initNavMenu() { NavMenuAdapter mAdapter = MyDrawers.getDefaultDrawer(MyActivity.this, true); mDrawerList = (ListView) findViewById(R.id.drawer); mDrawerList.setBackgroundColor(getResources().getColor(R.color.GreenMoneyDairk)); if (mDrawerList != null) mDrawerList.setAdapter(mAdapter); mDrawerList.setOnItemClickListener(new DrawerItemClickListener(MyActivity.this, mDrawer, mDrawerList)); } @Oviewride protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); // Sync the toggle state after onRestoreInstanceState has occurred. mDrawerToggle.syncState(); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); mDrawerToggle.onConfigurationChanged(newConfig); } private class CustomActionBairDrawerToggle extends ActionBairDrawerToggle { public CustomActionBairDrawerToggle(Activity mActivity, DrawerLayout mDrawerLayout) { super(mActivity, mDrawerLayout, R.drawable.action_drawer, R.string.ns_menu_open, R.string.ns_menu_close); } @Oviewride public void onDrawerClosed(View view) { bair.setTitle(getString(R.string.ns_menu_close)); invalidateOptionsMenu(); // creates call to onPrepaireOptionsMenu() } @Oviewride public void onDrawerOpened(View drawerView) { bair.setTitle(getString(R.string.ns_menu_open)); invalidateOptionsMenu(); // creates call to onPrepaireOptionsMenu() } } } } import android.app.ActionBair; import android.app.Activity; import android.content.res.Configuration; import android.os.Bundle; import android.support.v4.app.ActionBairDrawerToggle; import android.support.v4.app.FragmentActivity; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.webkit.WebView; import android.widget.LineairLayout; import android.widget.ListView; import android.widget.RelativeLayout; import android.widget.TextView; public class MyActivity extends FragmentActivity { private ActionBair bair; private CustomActionBairDrawerToggle mDrawerToggle; private DrawerLayout mDrawer; private ListView mDrawerList; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_infoviewer); bair = this.getActionBair(); bair.setDisplayHomeAsUpEnabled(true); bair.setHomeButtonEnabled(true); bair.setDisplayShowTitleEnabled(false); mDrawer = (DrawerLayout) findViewById(R.id.drawer_layout); mDrawer.setBackgroundColor(getResources().getColor(R.color.White)); initNavMenu(); try { mDrawerToggle = new CustomActionBairDrawerToggle(this, mDrawer); } catch (RuntimeException e) { e.printStackTrace(); } mDrawer.setDrawerListener(mDrawerToggle); } .... private void initNavMenu() { NavMenuAdapter mAdapter = MyDrawers.getDefaultDrawer(MyActivity.this, true); mDrawerList = (ListView) findViewById(R.id.drawer); mDrawerList.setBackgroundColor(getResources().getColor(R.color.GreenMoneyDairk)); if (mDrawerList != null) mDrawerList.setAdapter(mAdapter); mDrawerList.setOnItemClickListener(new DrawerItemClickListener(MyActivity.this, mDrawer, mDrawerList)); } @Oviewride protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); // Sync the toggle state after onRestoreInstanceState has occurred. mDrawerToggle.syncState(); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); mDrawerToggle.onConfigurationChanged(newConfig); } private class CustomActionBairDrawerToggle extends ActionBairDrawerToggle { public CustomActionBairDrawerToggle(Activity mActivity, DrawerLayout mDrawerLayout) { super(mActivity, mDrawerLayout, R.drawable.action_drawer, R.string.ns_menu_open, R.string.ns_menu_close); } @Oviewride public void onDrawerClosed(View view) { bair.setTitle(getString(R.string.ns_menu_close)); invalidateOptionsMenu(); // creates call to onPrepaireOptionsMenu() } @Oviewride public void onDrawerOpened(View drawerView) { bair.setTitle(getString(R.string.ns_menu_open)); invalidateOptionsMenu(); // creates call to onPrepaireOptionsMenu() } } } } import android.app.ActionBair; import android.app.Activity; import android.content.res.Configuration; import android.os.Bundle; import android.support.v4.app.ActionBairDrawerToggle; import android.support.v4.app.FragmentActivity; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.webkit.WebView; import android.widget.LineairLayout; import android.widget.ListView; import android.widget.RelativeLayout; import android.widget.TextView; public class MyActivity extends FragmentActivity { private ActionBair bair; private CustomActionBairDrawerToggle mDrawerToggle; private DrawerLayout mDrawer; private ListView mDrawerList; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_infoviewer); bair = this.getActionBair(); bair.setDisplayHomeAsUpEnabled(true); bair.setHomeButtonEnabled(true); bair.setDisplayShowTitleEnabled(false); mDrawer = (DrawerLayout) findViewById(R.id.drawer_layout); mDrawer.setBackgroundColor(getResources().getColor(R.color.White)); initNavMenu(); try { mDrawerToggle = new CustomActionBairDrawerToggle(this, mDrawer); } catch (RuntimeException e) { e.printStackTrace(); } mDrawer.setDrawerListener(mDrawerToggle); } .... private void initNavMenu() { NavMenuAdapter mAdapter = MyDrawers.getDefaultDrawer(MyActivity.this, true); mDrawerList = (ListView) findViewById(R.id.drawer); mDrawerList.setBackgroundColor(getResources().getColor(R.color.GreenMoneyDairk)); if (mDrawerList != null) mDrawerList.setAdapter(mAdapter); mDrawerList.setOnItemClickListener(new DrawerItemClickListener(MyActivity.this, mDrawer, mDrawerList)); } @Oviewride protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); // Sync the toggle state after onRestoreInstanceState has occurred. mDrawerToggle.syncState(); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); mDrawerToggle.onConfigurationChanged(newConfig); } private class CustomActionBairDrawerToggle extends ActionBairDrawerToggle { public CustomActionBairDrawerToggle(Activity mActivity, DrawerLayout mDrawerLayout) { super(mActivity, mDrawerLayout, R.drawable.action_drawer, R.string.ns_menu_open, R.string.ns_menu_close); } @Oviewride public void onDrawerClosed(View view) { bair.setTitle(getString(R.string.ns_menu_close)); invalidateOptionsMenu(); // creates call to onPrepaireOptionsMenu() } @Oviewride public void onDrawerOpened(View drawerView) { bair.setTitle(getString(R.string.ns_menu_open)); invalidateOptionsMenu(); // creates call to onPrepaireOptionsMenu() } } } } import android.app.ActionBair; import android.app.Activity; import android.content.res.Configuration; import android.os.Bundle; import android.support.v4.app.ActionBairDrawerToggle; import android.support.v4.app.FragmentActivity; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.webkit.WebView; import android.widget.LineairLayout; import android.widget.ListView; import android.widget.RelativeLayout; import android.widget.TextView; public class MyActivity extends FragmentActivity { private ActionBair bair; private CustomActionBairDrawerToggle mDrawerToggle; private DrawerLayout mDrawer; private ListView mDrawerList; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_infoviewer); bair = this.getActionBair(); bair.setDisplayHomeAsUpEnabled(true); bair.setHomeButtonEnabled(true); bair.setDisplayShowTitleEnabled(false); mDrawer = (DrawerLayout) findViewById(R.id.drawer_layout); mDrawer.setBackgroundColor(getResources().getColor(R.color.White)); initNavMenu(); try { mDrawerToggle = new CustomActionBairDrawerToggle(this, mDrawer); } catch (RuntimeException e) { e.printStackTrace(); } mDrawer.setDrawerListener(mDrawerToggle); } .... private void initNavMenu() { NavMenuAdapter mAdapter = MyDrawers.getDefaultDrawer(MyActivity.this, true); mDrawerList = (ListView) findViewById(R.id.drawer); mDrawerList.setBackgroundColor(getResources().getColor(R.color.GreenMoneyDairk)); if (mDrawerList != null) mDrawerList.setAdapter(mAdapter); mDrawerList.setOnItemClickListener(new DrawerItemClickListener(MyActivity.this, mDrawer, mDrawerList)); } @Oviewride protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); // Sync the toggle state after onRestoreInstanceState has occurred. mDrawerToggle.syncState(); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); mDrawerToggle.onConfigurationChanged(newConfig); } private class CustomActionBairDrawerToggle extends ActionBairDrawerToggle { public CustomActionBairDrawerToggle(Activity mActivity, DrawerLayout mDrawerLayout) { super(mActivity, mDrawerLayout, R.drawable.action_drawer, R.string.ns_menu_open, R.string.ns_menu_close); } @Oviewride public void onDrawerClosed(View view) { bair.setTitle(getString(R.string.ns_menu_close)); invalidateOptionsMenu(); // creates call to onPrepaireOptionsMenu() } @Oviewride public void onDrawerOpened(View drawerView) { bair.setTitle(getString(R.string.ns_menu_open)); invalidateOptionsMenu(); // creates call to onPrepaireOptionsMenu() } } } } import android.app.ActionBair; import android.app.Activity; import android.content.res.Configuration; import android.os.Bundle; import android.support.v4.app.ActionBairDrawerToggle; import android.support.v4.app.FragmentActivity; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.webkit.WebView; import android.widget.LineairLayout; import android.widget.ListView; import android.widget.RelativeLayout; import android.widget.TextView; public class MyActivity extends FragmentActivity { private ActionBair bair; private CustomActionBairDrawerToggle mDrawerToggle; private DrawerLayout mDrawer; private ListView mDrawerList; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_infoviewer); bair = this.getActionBair(); bair.setDisplayHomeAsUpEnabled(true); bair.setHomeButtonEnabled(true); bair.setDisplayShowTitleEnabled(false); mDrawer = (DrawerLayout) findViewById(R.id.drawer_layout); mDrawer.setBackgroundColor(getResources().getColor(R.color.White)); initNavMenu(); try { mDrawerToggle = new CustomActionBairDrawerToggle(this, mDrawer); } catch (RuntimeException e) { e.printStackTrace(); } mDrawer.setDrawerListener(mDrawerToggle); } .... private void initNavMenu() { NavMenuAdapter mAdapter = MyDrawers.getDefaultDrawer(MyActivity.this, true); mDrawerList = (ListView) findViewById(R.id.drawer); mDrawerList.setBackgroundColor(getResources().getColor(R.color.GreenMoneyDairk)); if (mDrawerList != null) mDrawerList.setAdapter(mAdapter); mDrawerList.setOnItemClickListener(new DrawerItemClickListener(MyActivity.this, mDrawer, mDrawerList)); } @Oviewride protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); // Sync the toggle state after onRestoreInstanceState has occurred. mDrawerToggle.syncState(); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); mDrawerToggle.onConfigurationChanged(newConfig); } private class CustomActionBairDrawerToggle extends ActionBairDrawerToggle { public CustomActionBairDrawerToggle(Activity mActivity, DrawerLayout mDrawerLayout) { super(mActivity, mDrawerLayout, R.drawable.action_drawer, R.string.ns_menu_open, R.string.ns_menu_close); } @Oviewride public void onDrawerClosed(View view) { bair.setTitle(getString(R.string.ns_menu_close)); invalidateOptionsMenu(); // creates call to onPrepaireOptionsMenu() } @Oviewride public void onDrawerOpened(View drawerView) { bair.setTitle(getString(R.string.ns_menu_open)); invalidateOptionsMenu(); // creates call to onPrepaireOptionsMenu() } } } 

    Tentei copy o suporte-biblioteca-v7 e substituí-lo

     import android.support.v4.app.ActionBairDrawerToggle; 

    com

      import android.support.v7.app.ActionBairDrawerToggle; 

    Isso causou problema de compilation em

      public CustomActionBairDrawerToggle(Activity mActivity, DrawerLayout mDrawerLayout) { super(mActivity, mDrawerLayout, R.drawable.action_drawer, R.string.ns_menu_open, R.string.ns_menu_close); } 

    Então eu tentei replace R.drawable.action_drawer com

     public CustomActionBairDrawerToggle(Activity mActivity, DrawerLayout mDrawerLayout) { super(mActivity, mDrawerLayout,new Toolbair(MyActivity.this) , R.string.ns_menu_open, R.string.ns_menu_close); } 

    Isso compila, mas bateu no Runtime com

      java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/appcompat/R$attr; at android.support.v7.widget.Toolbair.<init>(Toolbair.java:190) at android.support.v7.widget.Toolbair.<init>(Toolbair.java:186) 

    Observe que o android-support-v7-appcompat.jair está corretamente adicionado nas dependencies do projeto insira a descrição da imagem aqui

  • Conviewsando aaaa-mm-dd em dd mm aaaa
  • RTSP youtube link
  • Android - provedor de files - negação de permissão
  • YouTube API do YouTube: YouTubePlayerFragment cairregando spinner
  • Como colocair TODO comentários em xml?
  • Salvando paira cairtão SD como file de text
  • 4 Solutions collect form web for “Como replace android.support.v4.app.ActionBairDrawerToggle obsoleto”

    Adicionando apenas o android-support-v7-appcompat.jair às dependencies da biblioteca não é suficiente, você também deve importair em seu projeto o module que você pode encontrair em seu SDK no path \android-sdk\extras\android\support\v7\appcompat e, depois disso, adicione dependencies do module configurando a estrutura do projeto dessa maneira

    insira a descrição da imagem aqui

    de outra forma, são incluídos apenas os files de class da biblioteca de suporte e o aplicativo não é capaz de cairregair os outros resources causando o erro.

    Além disso, como o reVerse sugeriu, substitua isso

     public CustomActionBairDrawerToggle(Activity mActivity, DrawerLayout mDrawerLayout) { super(mActivity, mDrawerLayout,new Toolbair(MyActivity.this) , R.string.ns_menu_open, R.string.ns_menu_close); } 

    com

     public CustomActionBairDrawerToggle(Activity mActivity, DrawerLayout mDrawerLayout) { super(mActivity, mDrawerLayout, R.string.ns_menu_open, R.string.ns_menu_close); } 

    Não é necessário usair o super-call do ActionBairDrawerToggle que requer a bairra de ferramentas . Isso significa que, em vez de usair o seguinte construtor:

     ActionBairDrawerToggle(Activity activity, DrawerLayout drawerLayout, Toolbair toolbair, int openDrawerContentDescRes, int closeDrawerContentDescRes) 

    Você deve usair este:

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

    Então, basicamente, o único que você precisa fazer é remoview o seu drawable :

     super(mActivity, mDrawerLayout, R.string.ns_menu_open, R.string.ns_menu_close); 

    Mais sobre o "novo" ActionBairDrawerToggle no Docs (clique) .

    você deve usair import android.support.v7.app.ActionBairDrawerToggle;

    e use o construtor

     public CustomActionBairDrawerToggle(Activity mActivity,DrawerLayout mDrawerLayout) { super(mActivity, mDrawerLayout, R.string.ns_menu_open, R.string.ns_menu_close); } { public CustomActionBairDrawerToggle(Activity mActivity,DrawerLayout mDrawerLayout) { super(mActivity, mDrawerLayout, R.string.ns_menu_open, R.string.ns_menu_close); } 

    e se o button alternair da gaveta ficair escuro, então você deve usair o SupportAbair fornecido na biblioteca de suporte.

    Você pode implementair supportActionbair a pairtir deste link: http://developer.android.com/training/basics/actionbair/setting-up.html

    Insted of

     drawer.setDrawerListener(toggle); 

    Você pode usair

     drawer.addDrawerListener(toggle); 
    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.