Skip to content

Most visited

Recently visited

navigation
Added in API level 1

InvocationTargetException

public class InvocationTargetException
extends ReflectiveOperationException

java.lang.Object
   ↳ java.lang.Throwable
     ↳ java.lang.Exception
       ↳ java.lang.ReflectiveOperationException
         ↳ java.lang.reflect.InvocationTargetException


This class provides a wrapper for an exception thrown by a Method or Constructor invocation.

See also:

Summary

Public constructors

InvocationTargetException(Throwable exception)

Constructs a new InvocationTargetException instance with its cause / target exception filled in.

InvocationTargetException(Throwable exception, String detailMessage)

Constructs a new InvocationTargetException instance with its cause / target exception and message filled in.

Protected constructors

InvocationTargetException()

Constructs a new InvocationTargetException instance with a null cause / target exception.

Public methods

Throwable getCause()

Returns the cause of this exception, which may be null.

Throwable getTargetException()

Returns the target exception, which may be null.

Inherited methods

From class java.lang.Throwable
From class java.lang.Object

Public constructors

InvocationTargetException

Added in API level 1
InvocationTargetException (Throwable exception)

Constructs a new InvocationTargetException instance with its cause / target exception filled in.

Parameters
exception Throwable: the exception which occurred while running the Method or Constructor

InvocationTargetException

Added in API level 1
InvocationTargetException (Throwable exception, 
                String detailMessage)

Constructs a new InvocationTargetException instance with its cause / target exception and message filled in.

Parameters
exception Throwable: the exception which occurred while running the Method or Constructor
detailMessage String: the detail message for the exception

Protected constructors

InvocationTargetException

Added in API level 1
InvocationTargetException ()

Constructs a new InvocationTargetException instance with a null cause / target exception.

Public methods

getCause

Added in API level 1
Throwable getCause ()

Returns the cause of this exception, which may be null.

Returns
Throwable the cause of this exception

getTargetException

Added in API level 1
Throwable getTargetException ()

Returns the target exception, which may be null.

Returns
Throwable the target exception
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.