Code example for ActivityManager

Methods: getMemoryInfo

	protected static final String TAG = "ImagePicker";
	public static void show(Activity currentActivity) {
		ActivityManager am = (ActivityManager)currentActivity.getSystemService(Activity.ACTIVITY_SERVICE);
		ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
		Intent intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI);
		currentActivity.startActivityForResult(intent, IMAGE_PICKER_REQ_ID);
	//note: this must be forwarded into by mActivity 
	//return a true if the image picker detects the proper request code 
	public static boolean isImagePickerActivityResult(int requestCode) {
		return requestCode == IMAGE_PICKER_REQ_ID;
	public static Bitmap onImagePickerActivityResult(Activity currentActivity, int resultCode, int maxLength, Intent returnedIntent) {
		if (resultCode == Activity.RESULT_OK) {  
Connect your IDE to all the code out there  Get Codota for Java