i'm new in android may know,what difference between these , how use in android code. ontrimmemory(),system.gc()finalize().
ontrimmemory trim_memory_ui_hidden level called before onstop. when onstop called, means activity stopping, , android os might kill right away if needs to, should not expect more calls activity's callbacks aftet that, except onrestart , ondestroy.
the system.gc() reason says avoid system.gc() is pretty indicator of fundamentally broken code. code depends on correctness broken; rely on performance broken.
the java.lang.object.finalize() called garbage collector on object when garbage collection determines there no more references object. subclass overrides finalize method dispose of system resources or perform other cleanup
Comments
Post a Comment