tôi không biết nơi bạn nhìn, nhưng mã cho finish()
là này
/**
* Call this when your activity is done and should be closed. The
* ActivityResult is propagated back to whoever launched you via
* onActivityResult().
*/
public void finish() {
finish(DONT_FINISH_TASK_WITH_ACTIVITY);
}
trong đó kêu gọi việc thực hiện tin
/**
* Finishes the current activity and specifies whether to remove the task associated with this
* activity.
*/
private void finish(int finishTask) {
if (mParent == null) {
int resultCode;
Intent resultData;
synchronized (this) {
resultCode = mResultCode;
resultData = mResultData;
}
if (false) Log.v(TAG, "Finishing self: token=" + mToken);
try {
if (resultData != null) {
resultData.prepareToLeaveProcess(this);
}
if (ActivityManagerNative.getDefault()
.finishActivity(mToken, resultCode, resultData, finishTask)) {
mFinished = true;
}
} catch (RemoteException e) {
// Empty
}
} else {
mParent.finishFromChild(this);
}
}
quan trọng ở đây là ActivityManagerNative.getDefault().finishActivity
mà bạn có thể tìm thấy ở dòng 3359 trong tệp này https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/app/ActivityManagerNative.java
Nếu bạn muốn đi sâu hơn, bạn có thể theo dõi đường nhỏ.
Nguồn
2016-10-07 09:14:37
Bản sao có thể có của [SQLiteDatabase getWritableDatabase() {throw new RuntimeException ("Stub!"); }] (https://stackoverflow.com/questions/27651148/sqlitedatabase-getwritabledatabase-throw-new-runtimeexceptionstub) –