Code example for Fragment

Methods: getActivityonStart

0
		return inflater.inflate(R.layout.fragment_capture, container, false);
	} 
 
	@Override 
	public void onStart() { 
		super.onStart(); 
 
		// This is a good forced option 
		Window window = getActivity().getWindow();
		window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
 
		hasSurface = false;
	} 
 
	@SuppressWarnings("deprecation") 
	@Override 
	public void onResume() { 
		super.onResume(); 
 
		// Setup camera view