How to "kill" an activity to avoid the memory usage?
Is there a reason you want your code to explicitly remove an activity from memory? When system memory is needed, the Android system will automatically remove any paused or stopped activities from memory.
I have problems about memory . We have 21 activities and when I use a lot the app, the device starts to respond slowly and in one moment show message of "range out memory" o something like that and I can't continue using the app. I use sqlite database and I'm looking the best way to avoid that because the issue is when I want to load other activity again. I'm using global variables to pass the data of an activity to other.
Generally speaking you call Finish(), consider this method in an activity:
var intent = new Intent(this, typeof(NextActivity));
You could have your Activity call finish()
This might cause the system to free memory more quickly. (I'm just guessing about this.)
Xamarin Inc., as a wholly-owned Microsoft subsidiary acting as a separate legal entity, adheres to the Microsoft Privacy Statement: Privacy & cookies