User submissions are the sole responsibility of contributors, with TuteeHUB disclaiming liability for accuracy, copyrights, or consequences of use; content is for informational purposes only and not professional advice.
While working with my android app, I found out that navigation drawer hangs while opening as well as closing. It hangs for 2-3 seconds. On most devices, it's fine (mostly with Stock Android) but on some devices, it hangs (Mostly Samsung).
Home.java (activity in which drawer is implemented):
publicclassHomeextendsAppCompatActivityimplementsNavigationView.OnNavigationItemSelectedListener{Fragment fragment;publicvoidMsgBox(String title,String msg,intid){newLovelyInfoDialog(this).setTopColorRes(R.color.primary).setIcon(R.drawable.ic_info_white_24dp)//This will add Don't show again checkbox to the dialog. You can pass any ID as argument.setNotShowAgainOptionEnabled(id).setTitle(title).setMessage(msg).show();}publicboolean showAds(){SharedPreferences getPrefs =PreferenceManager.getDefaultSharedPreferences(getBaseContext());boolean showAd = getPrefs.getBoolean("showAd",true);return showAd;}publicstaticboolean hasPermissions(Context context,String... permissions){if(android.os.Build.VERSION.SDK_INT >=Build.VERSION_CODES.M && context !=null&& permissions !=null){for(String permission : permissions){if(ActivityCompat.checkSelfPermission(context, permission)!=PackageManager.PERMISSION_GRANTED){returnfalse;}}}returntrue;}@Overrideprotectedvoid onCreate(Bundle savedInstanceState){super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);Toolbar toolbar =(Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
hasPermissions(this,Manifest.permission.WRITE_EXTERNAL_STORAGE,Manifest.permission.GET_ACCOUNTS);
No matter what stage you're at in your education or career, TuteeHUB will help you reach the next level that
you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice
sessions to improve your knowledge and scores.
manpreet
Best Answer
3 years ago
While working with my android app, I found out that navigation drawer hangs while opening as well as closing. It hangs for 2-3 seconds. On most devices, it's fine (mostly with Stock Android) but on some devices, it hangs (Mostly Samsung).
Home.java (activity in which drawer is implemented):