Back to project page vlcamera.
The source code is released under:
Apache License
If you think the Android project vlcamera listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/* author:huydx/*from www .ja va 2 s .c om*/ github:https://github.com/huydx */ package com.ktmt.vlcamera.custom; import android.app.Activity; import android.os.Bundle; public class BaseActivity extends Activity { protected BaseApplication mMainApp; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mMainApp = (BaseApplication)this.getApplicationContext(); } protected BaseApplication getBaseApplication() { return (BaseApplication) getApplication(); } protected void onResume() { super.onResume(); mMainApp.setCurrentActivity(this); } protected void onPause() { clearReferences(); super.onPause(); } protected void onDestroy() { clearReferences(); super.onDestroy(); } private void clearReferences(){ Activity currActivity = mMainApp.getCurrentActivity(); if (currActivity != null && currActivity.equals(this)) mMainApp.setCurrentActivity(null); } }