java - How to let app to close its GUI and work in background in android -


i need know if there way let application close gui once clicked specific button , complete work in background... if opened application again need resume work in background , need resume same status of button in background.

i need perform task programaticaly.

use services work in background. , remove ui , not close app (kill process) need following code execute on button.this code bring home screen , let android decide if app has spent time in background , android may close work defined in service remains running untill finishes.

intent intent = new intent(intent.action_main); intent.addcategory(intent.category_home); intent.setflags(intent.flag_activity_new_task); startactivity(intent); 

keep rockin :d


Comments