2012-04-03 11:58:01 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
package org.mozilla.gecko;
|
|
|
|
|
|
|
|
import android.app.Activity;
|
|
|
|
|
|
|
|
public class GeckoActivity extends Activity {
|
|
|
|
@Override
|
|
|
|
public void onPause() {
|
|
|
|
super.onPause();
|
|
|
|
|
2012-09-14 08:19:40 -07:00
|
|
|
if (getApplication() instanceof GeckoApplication) {
|
2012-04-03 11:58:01 -07:00
|
|
|
((GeckoApplication) getApplication()).onActivityPause(this);
|
2012-09-14 08:19:40 -07:00
|
|
|
}
|
2012-04-03 11:58:01 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onResume() {
|
|
|
|
super.onResume();
|
|
|
|
|
2012-09-14 08:19:40 -07:00
|
|
|
if (getApplication() instanceof GeckoApplication) {
|
2012-04-03 11:58:01 -07:00
|
|
|
((GeckoApplication) getApplication()).onActivityResume(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isApplicationInBackground() {
|
2012-05-08 16:40:12 -07:00
|
|
|
return ((GeckoApplication) getApplication()).isApplicationInBackground();
|
2012-09-19 12:21:19 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onLowMemory() {
|
|
|
|
MemoryMonitor.getInstance().onLowMemory();
|
|
|
|
super.onLowMemory();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onTrimMemory(int level) {
|
|
|
|
MemoryMonitor.getInstance().onTrimMemory(level);
|
|
|
|
super.onTrimMemory(level);
|
|
|
|
}
|
2012-10-31 22:10:59 -07:00
|
|
|
|
|
|
|
public LightweightTheme getLightweightTheme() {
|
|
|
|
return ((GeckoApplication) getApplication()).getLightweightTheme();
|
|
|
|
}
|
2012-04-03 11:58:01 -07:00
|
|
|
}
|