Posts

Showing posts from February, 2019

Java 8: Sorting of Collection using lambda Expression

Image
In my previous blog, I have already discussed on Lambda Expression and its Syntax as well as Functional Interface. So, if you are not aware of then I would suggest you to read those blogs before starting this one. http://www.waheedtechblog.com/2019/01/how-to-write-lambda-expression-in-java-8.html http://www.waheedtechblog.com/2019/01/functional-interface-and-lambda.html As we know Comparator Interface is also a Functional Interface as it has only one abstract method. In this blog, we will see how we can do sorting using lambda expression. Let’s start with List and will cover Set, Map as well as Custom Class as well. List Sorting of elements on any Array List can be done easily using Collections.sort(…) functions where sort() can take argument as list or with list, you can also pass comparator object. In below example, we will see how can we sort using comparator and the same task with lambda expression. Output: 2  2.   ...

Don't clear logs after app get crashed - Android Studio

Image
Currently, I am working on one app which keep getting crash at PIE version and I was not getting any crash log under logcat. After some research here and there, I get to know that by default logcat logs based on selected process and once your app get crashes, it will clear the crash log as the existing process is gone. To see the crash logs: ·         Goto logcat and click on right hand side drop down button and select Edit Configuration. ·         Add Filter Name as your app Name and project Name as Package Name. Save it. Now try again. You will able to see your app crash log now.   Thank you. Happy Coding…!!!