How can i close my application programmatically?
but it closed the current running activity, but i need to close the whole application??
I need to close app to retrieve some memory and then restart application again.
does there is a way to clear all memory of the application?
Using these lines in your activity:-
this.finish(); Process.killProcess( Process.myPid() );
will kill your whole application (assuming its running in a single process) it will also free any associated memory.
WARNING: On some phones doing this may leave bluetooth sockets dangling if you are using them.