Java Code Examples for android.app.Activity#onLowMemory()

The following examples show how to use android.app.Activity#onLowMemory() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MemoryPressureListener.java    From cronet with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private static void simulateLowMemoryPressureSignal(Activity activity) {
    // The Application and the Activity each have a list of callbacks they notify when this
    // method is called.  Notifying these will simulate the event at the App/Activity level
    // as well as trigger the listener bound from native in this process.
    activity.getApplication().onLowMemory();
    activity.onLowMemory();
}
 
Example 2
Source File: MemoryPressureListener.java    From 365browser with Apache License 2.0 5 votes vote down vote up
private static void simulateLowMemoryPressureSignal(Activity activity) {
    // The Application and the Activity each have a list of callbacks they notify when this
    // method is called.  Notifying these will simulate the event at the App/Activity level
    // as well as trigger the listener bound from native in this process.
    activity.getApplication().onLowMemory();
    activity.onLowMemory();
}
 
Example 3
Source File: MemoryPressureListener.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private static void simulateLowMemoryPressureSignal(Activity activity) {
    // The Application and the Activity each have a list of callbacks they notify when this
    // method is called.  Notifying these will simulate the event at the App/Activity level
    // as well as trigger the listener bound from native in this process.
    activity.getApplication().onLowMemory();
    activity.onLowMemory();
}
 
Example 4
Source File: MemoryPressureListener.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private static void simulateLowMemoryPressureSignal(Activity activity) {
    // The Application and the Activity each have a list of callbacks they notify when this
    // method is called.  Notifying these will simulate the event at the App/Activity level
    // as well as trigger the listener bound from native in this process.
    activity.getApplication().onLowMemory();
    activity.onLowMemory();
}