Use Log.e instead of e.printStackTrace.