Technical details of Android Garbage Collector

To answer one of your questions, the Dalvik VM indeed does use a tracing garbage collector, using a Mark and Sweep approach. According to The Dalvik Virtual Machine Architecture: The current strategy in the Dalvik garbage collector is to keep mark bits, or the bits that indicate that a particular object is “reachable” and therefore … Read more

Intent.putExtras size limit?

if both activities are yours, use a decent data model. Android doesn’t encourage that much to very well designed application. Or turn it differently, it allows for fast developped application and doesn’t promote much of good software application principle. The solution of @Jean-Philippe Roy (québec ?) is interesting but singleton are quite an anti-pattern when … Read more

How to detect “Recent Apps” system button clicks (Honeycomb+)

None of standard Activity Lifecycle methods is called when “Recent Apps” button pressed. Activity will stay active after list of recent apps popups. Through semi-transparent left part of this list you can even observe application animation is still running, if you running a game with some animation that didn’t handle this situation properly. Actually many … Read more

Custom Translucent Android ActionBar

If you want your activity to be fullscreen but still show an actionbar, but with an alpha you have to request overlaymode for the actionbar in onCreate() of your activity: getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY); //getWindow().requestFeature(WindowCompat.FEATURE_ACTION_BAR_OVERLAY); << Use this for API 7+ (v7 support library) Then after you call setContentView(..) (since setContentView(..) also initializes the actionbar next to setting … Read more

How to implement the Android ActionBar back button?

Selvin already posted the right answer. Here, the solution in pretty code: public class ServicesViewActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // etc… getActionBar().setDisplayHomeAsUpEnabled(true); } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: NavUtils.navigateUpFromSameTask(this); return true; default: return super.onOptionsItemSelected(item); } } } The function NavUtils.navigateUpFromSameTask(this) requires you to … Read more