Fix: Restore Android 2.2 compatibility

"isEmpty()" method is level9, so replaced to "length()==0"