あなたが見てどこ私は知らないが、finish()
のコードは、あなたがライン3359で見つけることができるActivityManagerNative.getDefault().finishActivity
あり、ここで重要な
/**
* 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);
}
}
プライベート実装を呼び出し、この
/**
* 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);
}
ですこのファイルのhttps://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/app/ActivityManagerNative.java
さらに深く掘り下げたい場合は、その道をたどることができます。
可能な複製[SQLiteDatabase getWritableDatabase(){throw new RuntimeException( "Stub!"); }](https://stackoverflow.com/questions/27651148/sqlitedatabase-getwritabledatabase-throw-new-runtimeexceptionstub) –