本帖最后由 love_xiaozhao 于 2011-06-20 10:54:39 编辑

解决方案 »

  1.   

    楼主可以试下这几种方法:
     1. android.os.Process.killProcess(android.os.Process.myPid()) //获取PID  System.exit(0); //常规java、c#的标准退出法,返回值为0代表正常退出 2. 
        ActivityManager am = (ActivityManager)getSystemService (Context.ACTIVITY_SERVICE);  am.restartPackage(getPackageName());
      

  2.   

    System.exit(0); 应该可以吧。。
      

  3.   

    看看 我写的···基本都用了·但是不可以··· Intent i = new Intent(AirFluxActivity.this, StartActivityService.class);
    AirFluxActivity.this.stopService(i);
    am.restartPackage(this.getPackageName());
    Intent startMain = new Intent(Intent.ACTION_MAIN);// ACTION_CLOSE_SYSTEM_DIALOGS
    startMain.addCategory(Intent.CATEGORY_HOME);
    startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    startActivity(startMain);
    Intent intent = new Intent();
    intent.setClass(getApplicationContext(), AirFluxActivity.class);
    intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); // 注意本行的FLAG设置
    startActivity(intent);
    android.os.Process.killProcess(android.os.Process.myPid());
    System.exit(0);