Advancing Backwards

Boldly going in the wrong direction since 2008

Browsing Posts in Android

One thing I’ve been grappling with recently is how to get home screen applications widgets to work for my application. There is a decent tutorial in the Android developer documents about the subject (located here), but it doesn’t really go into too much detail on how to make your widgets interactive. Sure, it shows you how to set up an OnClickListener on an element of your widget to load an activity from elsewhere, but what if you want the widget to do something more, like redraw itself with a new image when its clicked? This seems pretty simple, but to be honest, it took me a lot of fiddling to get it to happen.

continue reading…

In my ongoing quest to write about little known or poorly documented features of Android, I stumbled across something this morning that I feel needs a little bit more exposure, as it frustrated me for quite a while trying to figure it out.

continue reading…

Here’s something handy I learned with Android the other day.

Lets say you have two activities. The first one, A, has a button that opens up the second activity, B. B, in turn has a button that returns the user to activity A. So, if you were to push the button in activity A, you would end up in activity B and vice versa. Pretty straight forward.

Now, lets say you just pushed the button in activity A, and ended up in activity B. You now want to go back to activity A. Pretty simple, just push the button in B, right? While if we push the button, we do in fact end up looking at activity A again, but it is not, in fact, the same instance of activity A that brought us to B in the first place.

continue reading…