I am newbie to android. I have client server based application. Server keeps on sending the update notifications to client after every single minute and at client side my ap
Only for API level 14 and above
You can use ComponentCallbacks2 to an activity, service, etc.
Example:
public class MainActivity extends AppCompatActivity implements ComponentCallbacks2 {
@Override
public void onConfigurationChanged(final Configuration newConfig) {
}
@Override
public void onLowMemory() {
}
@Override
public void onTrimMemory(final int level) {
if (level == ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN) {
// app is in background
}
}
}