I take that back a bit. The database read fails to acquire the lock even though the write (in another thread) does release it. The reads in the writing thread do work (because they are in the same thread, as per the lock design) as do the reads in the UI thread. But in this one particular thread the read fails. Grr…

Today’s Android headaches: multithreaded database access and some weirdness with asynchoronous tasks.

In the former, a lock-controlled read from the database gets stuck because some other operation (which one, I have no idea, all the other locked reads and writes should have been ready by that) has not released the lock. In the latter, an AsyncTask that (supposedly) should perform its operations in a certain order (pre-execute in the calling thread, the actual task in a background thread, and post-execute again in the calling thread) calls them in the wrong order (in this case, the pre-execute after post-execute).

Now, where did we put our booze…

Yep. Small coins you use(d) to pay your coffee.

As they say in Swedish, kaffepengar? ?

It is fine, but, gosh, why does it have make everything so darn complicated? There are a lot simpler, more straightforward ways to achieve the same thing. Well, the same thing happens with every programming language, platform, etc. nowadays. Sigh…

Also, I'm currently reading some NodeJS code just in case I need to take a look at the server side of things while the main guy is away. The Douche said that "it is fun and easy". Well, it will not be fun nor easy, that I can say. While the code is pretty readable, it is still NodeJS.

Thank you Google for writing such a shitty Android library that makes my head ache once again. The problem has been reported to you ages ago, please fix your shit.

Luckily someone had made a workaround already, I just needed to copy-paste that solution to the project and do some minor adjustments. Now the adapter can remove pages from a pager just fine.

There might be a correlation, yes…

Well, it is that huge leap also in practice… :)

//

A colleague of mine replied to my re-post of that link with the following:

I can't have glittery poop. It's against my morals. Glittery poop belongs to unicorns.

//