What is the difference between onCreateOptionsMenu(Menu menu) and onPrepareOptionsMenu(Menu menu)?

onCreateOptionsMenu() is called once. onPrepareOptionsMenu() is called every time the menu opens. From the onCreateOptionsMenu() documentation: This is only called once, the first time the options menu is displayed. To update the menu every time it is displayed, see onPrepareOptionsMenu(Menu).

onCreateOptionsMenu is never called

In the latest versions of Android when using the compat library for toolbar, is very common that this happens, in order to get the menu items to display in the toolbar you must do the following: mToolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(mToolbar); getSupportActionBar().setDisplayShowTitleEnabled(false);

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)