3、requestCode) ,关于这个方法,先看看sdk的api说明吧! public voidfinishActivity (int requestCode) Since: APILevel 1 Force finishanother activity that you had previously started withstartActivityForResult(Intent, int). ParametersrequestCode The request code of th
4、e activity that you had given tostartActivityForResult(). If there are multiple activities started with thisrequest code, they will all be finished. 也许你会这样理解 ,Activity1 通过方法startActivityForResult (Intent, int) 启动Activity2,然后在Activity2 中通过方法finishActivity (i
6、t requestCode)来结束Activity2。(一般在onActivityResult 方法调用该方法结束Activity2)。 Force finishanother activity that you had previously started withstartActivityForResult(Intent, int). Parameters 还有,下面两个方法,可以参阅文档以及源码研究一下。 finishActivityFromChild(Activity chil
7、d, int requestCode) finishFromChild(Activity child) 2. killProcess 通过调用android.os.Process 的相关方法,结束App,示例如下: btn_exit.setOnClickListener(new Button.OnClickListener() { @Override public voidonClick(View v) { android.os.Process.killProcess(androi