Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

meaning of RuntimeException("Stub!") in Android

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!

like image 311
Alex Mawashi Avatar asked Oct 07 '16 09:10

Alex Mawashi


People also ask

What is a RuntimeException?

RuntimeException is the superclass of those exceptions that can be thrown during the normal operation of the Java Virtual Machine. RuntimeException and its subclasses are unchecked exceptions.

What are runtime exceptions in Java give example?

Runtime - runtime exceptions are internal to your application but are not typically recoverable. For example, an object that is expected to have a value but is actually null. In this case, a NullPointerException exception would be thrown.


1 Answers

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

like image 57
hakim Avatar answered Sep 16 '22 22:09

hakim