LinearLayout v = (LinearLayout)findViewById(R.id.YourLayoutThatContainsEverything);
if(v != null){
	v.setDrawingCacheEnabled(true);	
	Bitmap bmp = v.getDrawingCache();
	try {
		FileOutputStream out = new FileOutputStream(Environment
				.getExternalStorageDirectory()+"Test.jpg");
		bmp.compress(Bitmap.CompressFormat.JPEG, 90, out);
	} catch (FileNotFoundException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
}
else
	Toast.makeText(this, "View not available in this activity", Toast.LENGTH_LONG);