Documentation

Setup


google: lint

Repeatedly, I made few mistakes while using the new registerForActivityResultAPI, resulting in error:

Fatal Exception: java.lang.IllegalStateException: Fragment MyFragment{e964a6} (573498bb-7d87–4d58–9e84–59223f13f14c) id=0x7f0a00b3} is attempting to registerForActivityResult after being created. Fragments must call registerForActivityResult() before they are created (i.e. initialization, onAttach(), or onCreate()). at androidx.fragment.app.Fragment.prepareCallInternal(Fragment.java:3) …

Most common implementation of Delegation pattern is when the responsibility of the class is delegated to a real object of a concrete implementation of the same interface.

class HomeAcrobat implements Acrobat {
private final Acrobat mProAcrobat = new CircusAcrobat();
@Override
public void doAmazingStuff(){
mProAcrobat.doAmazingStuff();
}
}

Kotlin gives amazing and…


The very first crash I got when started Kotlin was, you may guess, UninitializedPropertyAccessException, because somewhere I used lateinit var property without prior initialization. This thought me to be more careful with fields (Java) and properties.

1.2, y tho?


courtesy of Manuel Vicente Vivo

I always liked and found entertaining messing around with operators in C++, back in the days.

There are plethora of short ways to write RecyclerView.Adapter in Kotlin, I wondered how can I get rid of functions that perform operations on the adapter.

Kotlin offers ability to overload operator for all…


gizmodo.com

When I thought I’m the first one to experience hard time injecting parameterized ViewModel into Activity/Fragment, stretched my fingers to google and found few places where developers struggled before. Here, here and here.

The Factory


This is going to be really short tip how to iterate over Cursor using RxJava. I promise!

In RxJava, we can emit items from Iterable as Observable.fromArray(). Cursor is structure that can be iterated, given his methods, but it does not implement Iterator.

IteratingCursor with Observablewill grant you opportunities to…


Google Photos is fascinating application, I admire every bit of it. Selection of photos is done right and seamless. …


[Courtesy of gringo4tech]

It’s been a lot of time since I have written something interesting on Android. Following post is on how should we properly listen for camera being released. Duh!

Assume we are have to make our Service aware of camera usage, like Google Photos does it with the option to show…


Android support 25.0.0 new BottomNavigationView outguns all other libraries on the streets. In my previous post on BottomNavigation Behavior, I have explained how should this view benefit and follow the guidelines.

I’ve made quick excursion through the source of BottomNavigationView and I could help but notice that this view does…

Nikola Despotoski

Knitting code. One line at a time. @ WS Audiology

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store