I want to use assert obj != null : \"object cannot be null\" on Android device. The assert doesn\'t seem to work, so I searched online and I found this local so
assert obj != null : \"object cannot be null\"
if (somevar == null) throw new RuntimeException();
Replace RuntimeException() with an appropriate exception subtype.