Is it possible to grey out (not just disable) a MenuItem in Android?

On all android versions, easiest way to use this to SHOW a menu action icon as disabled AND make it FUNCTION as disabled as well: @Override public boolean onPrepareOptionsMenu(Menu menu) { MenuItem item = menu.findItem(R.id.menu_my_item); if (myItemShouldBeEnabled) { item.setEnabled(true); item.getIcon().setAlpha(255); } else { // disabled item.setEnabled(false); item.getIcon().setAlpha(130); } }

When to use ellipsis after menu items

The crucial factor is whether the menu option requires additional information (input or a selection) before it carries out the operation. So Help-About doesn’t require an ellipsis, but File-Open does. That’s what the Microsoft, Apple and KDE guidelines say anyway. Microsoft Windows applications are supposed to follow Microsoft’s “User Experience Guidelines”. Here’s what they say … Read more

Twitter Bootstrap add active class to li

For Bootstrap 3: var url = window.location; // Will only work if string in href matches with location $(‘ul.nav a[href=”‘+ url +'”]’).parent().addClass(‘active’); // Will also work for relative and absolute hrefs $(‘ul.nav a’).filter(function() { return this.href == url; }).parent().addClass(‘active’); Update For Bootstrap 4: var url = window.location; // Will only work if string in href … Read more

Android Create a simple menu programmatically

A–C’s method works, but you should avoid setting the click listeners manually. Especially when you have multiple menu items. I prefer this way: private static final int MENU_ITEM_ITEM1 = 1; … @Override public boolean onCreateOptionsMenu(Menu menu) { menu.add(Menu.NONE, MENU_ITEM_ITEM1, Menu.NONE, “Item name”); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case … Read more

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