meaning of RuntimeException("Stub!") in Android

Alex Mawashi picture Alex Mawashi · Oct 7, 2016 · Viewed 16.3k times · Source

I was surfing in Android code because I wanted to see what is into Activity.finish() method.

I just wanted to have the confirmation that in Activity.finish() there would be a call to onDestroy() method.

But what I found in this method (and in many others) was:

public void finish() {
    throw new RuntimeException("Stub!");
}

So WHERE Can I find the code that really destroys the Activity? Thanks!

Answer

hakim picture hakim · Oct 7, 2016

This is because source code is not found in SDK. To see the source code, you need to download source for Android SDK, so Android studio can display the respective code. See this image