Tag: unexpected

View.setEnabled versus android:enabled

This post will be about an interesting observation I made when working on a custom View that did not extend EditText, but contained one.

Read more →

Dangers of multi-catch in Android

One of the new features introduced in Java 7 was the possibility to handle multiple exception types in a single catch block.

Starting with March 2014 (added in SDK Tools 22.6), this feature can be used for Android applications too when targeting Android Froyo or later.

However, in Android, there is a special case where multi-catch can bring trouble for the developers.

Read more →

Reference resources caRefully

I knew that I would write a post about this phenomenon as soon as I met it.

Here is the story: during my work, I was assigned to fix a bug. The bug was the following: when navigating to a certain screen, the application crashed with ClassCastException saying that I cannot cast Linearlayout to FrameLayout.

I checked the layout file that was inflated, and the root element was indeed FrameLayout, making the error seem impossible. But then… what was wrong?

Read more →