Code example for Bitmap

Methods: compressisRecycledrecycle

0
			e.printStackTrace();
		} 
		 
		ContentValues value = new ContentValues();
		ByteArrayOutputStream out = new ByteArrayOutputStream();
		bitmap.compress(Bitmap.CompressFormat.PNG, 100, out);
		value.put(KEY_IMAGE, out.toByteArray());
		db.insert(DATABASE_MAIN_TABLE, null, value);
		 
		try { 
			if (out != null)
				out.close();
		} catch (IOException e) {
			e.printStackTrace();
		} 
		 
		if (! bitmap.isRecycled()){
			bitmap.recycle();
		} 
	} 
 
	public synchronized Bitmap getFirstImageFromDB() throws SQLException {
		Cursor cur = db.query(true, DATABASE_MAIN_TABLE, allItemNames, null,
Contextual code suggestions in your IDE  Get Codota for Java