Levi's blog

Author: Levi Notik

Android Loopers, Handlers, RuntimeExceptions explained…

What’s a Looper, what’s a Handler and what’s up with “Can’t create handler inside thread that has not called Looper.prepare()” NOTE: as always, consider everything I say as prefaced with “my understanding is that…” A Looper is a simple message loop for a thread. Once loop() is called, an unending loop (literally while (true)) waits […]

Demystifying Context in Android

The topic of Context in Android seems to be confusing too many. People just know that Context is needed quite often to do basic things in Android. People sometimes panic because they try to do perform some operation that requires the Context and they don’t know how to “get” the right Context. I’m going to […]

Android custom fonts and memory issues: a quick fix

Android allows you to import custom fonts into your project (just copy a .ttf file into your assets folder and you’re good to go). Typically, you’ll grab the custom font, like this Typeface myTypeface = Typeface.createFromAsset(getResources().getAssets(), "fonts/DroidSerif-Bold.ttf"); If you’re using custom fonts a lot (constantly grabbing the font inside of your Views or Activities), it […]

Back to top
Close Bitnami banner
Bitnami