Guava Multimap demo

The problem Handling maps that store collection of items under each key is very common. The thing I have in mind is this: Map<String, List<Integer>> playerScoresMap = new HashMap<String, List<Integer>>(); Let's assume that it stores scores for players. The player name is the key, and the value is a list of points scored by the … Continue reading Guava Multimap demo

Android status bar notifications [complete tutorial with source code]

Displaying status bar notification is a common way to unobtrusively inform user that something has happened (like new GMail message notification). In your app you can display it whenever you want. I will guide you how to do it from basics. This is how notifications are presented to the user: Google's documentation regarding the notifications … Continue reading Android status bar notifications [complete tutorial with source code]

Android: Action listener on EditText change

If business logic requires to trigger any kind of action right after the user changes text in EditText View, the TextWatcher listener can be used. Good example of use is filter, that updates when user provides filtering criteria. Add textChanged listener to EditText: myEditText.addTextChangedListener(onSearchFieldTextChanged); Implement listener to perform desired actions: TextWatcher onSearchFieldTextChanged = new TextWatcher(){ … Continue reading Android: Action listener on EditText change