Facebook Twitter

Android - Starting Activity from Fragment causes NullPointerException. Change I8ba585bc: Fix potential NPE when saving fragment state. Issue 19917 - android - ViewPager NullPointerException when onPause is called from activity and ViewPager has no adapter set. - Android - An Open Handset Alliance Project. Horizontal View Swiping with ViewPager. Posted by Rich “geekyouup” Hyndman, inspired by the fact that life just got that little bit easier Updated Dec 12 2012 It has been over a year since the ViewPager launched and in that time it’s been used by many developers to improve the user experience of their applications.

Horizontal View Swiping with ViewPager

Animation. Invoked when the garbage collector has detected that this instance is no longer reachable.


The default implementation does nothing, but this method can be overridden to free resources. Note that objects that override finalize are significantly more expensive than objects that don't. Finalizers may be run a long time after the object is no longer reachable, depending on memory pressure, so it's a bad idea to rely on them for cleanup. Note also that finalizers are run on a single VM-wide finalizer thread, so doing blocking work in a finalizer is a bad idea. GridLayout Library for Android 1.5+ Support. If you're like me, when you first heard about GridLayout, you were excited.

GridLayout Library for Android 1.5+ Support

Then disappointed, because it's currently only available for Ice Cream Sandwich. That is true no longer - I've taken the time to port a working version of it all the way back to Android 1.5 and above. Check out the android-gridlayout library here. GridLayout. A layout that places its children in a rectangular grid.


The grid is composed of a set of infinitely thin lines that separate the viewing area into cells. Throughout the API, grid lines are referenced by grid indices. A grid with N columns has N + 1 grid indices that run from 0 through N inclusive. Regardless of how GridLayout is configured, grid index 0 is fixed to the leading edge of the container and grid index N is fixed to its trailing edge (after padding is taken into account). HoneycombGallery - Honeycomb Gallery. Welcome to code samples for Android developers.

HoneycombGallery - Honeycomb Gallery

Here you can browse sample code and learn how to build different components for your applications. Use the categories on the left to browse the available samples. Each sample is a fully functioning Android app. Fragments. A Fragment represents a behavior or a portion of user interface in an Activity.


You can combine multiple fragments in a single activity to build a multi-pane UI and reuse a fragment in multiple activities. You can think of a fragment as a modular section of an activity, which has its own lifecycle, receives its own input events, and which you can add or remove while the activity is running (sort of like a "sub activity" that you can reuse in different activities). A fragment must always be embedded in an activity and the fragment's lifecycle is directly affected by the host activity's lifecycle. For example, when the activity is paused, so are all fragments in it, and when the activity is destroyed, so are all fragments. Acra - Application Crash Report for Android.