0

Last week, I asked a question about how to finish my progress entirely,someone tell me to do it like this:

finish();
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.addCategory(Intent.CATEGORY_HOME);
startActivity(intent);

but the question is: I try to get JSONObject from my server,so I new Thread and use handler to handle this. but now, I can't finish my progress!!

when I start my app , I can find a new progress in DDMS !!!!!what's wrong??

Praveenkumar
  • 24,084
  • 23
  • 95
  • 173
Stilo
  • 23
  • 2
  • Because, If you're using above code. It won't stop your app properly. Its just do like pressing home button from app. So, you've to properly quit your app as per in [this answer](http://stackoverflow.com/a/11430255/940096) or `user:LalitPoptani`'s answer if you want to close. – Praveenkumar Jul 25 '12 at 06:45
  • If by progress you mean process, Android does not kill your process entirelly when you close your app. – AggelosK Jul 25 '12 at 06:49
  • Use [AsyncTask](http://developer.android.com/reference/android/os/AsyncTask.html) instead of thread so you can cancel it when you want.. – user370305 Jul 25 '12 at 07:00

0 Answers0