Java 8 streams demo part 2: Stream of custom objects

Following the List with primitive types like in post here: Java 8 Streams demo, now it's time to demonstrate streams with custom objects. Please read mentioned post first to get the idea of this one faster. Introduction Now I want to have a list of Users. User is a POJO having a name and age. … Continue reading Java 8 streams demo part 2: Stream of custom objects

Java 8 Streams demo

Why streams? Nearly every Java app iterates collections, making operations on its elements, searching, changing them, sorting and so on. Streams are more readable way of doing this. Streams operations are to some excent similar to SQL Query operations - you can select, filter, order items in collection. What is a stream Stream is a … Continue reading Java 8 Streams demo

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