# Fragment.InstantiationException

Added in[API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# InstantiationException

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/app/Fragment.InstantiationException "View this page in Java")  

```
open class InstantiationException : AndroidRuntimeException
```

|---|---|---|---|---|--------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                         ||||||
| ↳ | [kotlin.Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)                                                          |||||
|   | ↳ | [java.lang.Exception](https://developer.android.com/reference/kotlin/java/lang/Exception.html#)                                                     ||||
|   |   | ↳ | [java.lang.RuntimeException](https://developer.android.com/reference/kotlin/java/lang/RuntimeException.html#)                                    |||
|   |   |   | ↳ | [android.util.AndroidRuntimeException](https://developer.android.com/reference/kotlin/android/util/AndroidRuntimeException.html#)             ||
|   |   |   |   | ↳ | [android.app.Fragment.InstantiationException](https://developer.android.com/reference/kotlin/android/app/Fragment.InstantiationException#) |

*** ** * ** ***

| **This exception was deprecated in API level 28.**
|
| Use androidx.fragment.app.Fragment.InstantiationException

Thrown by[Fragment.instantiate(Context, String, Bundle)](https://developer.android.com/reference/kotlin/android/app/Fragment#instantiate(android.content.Context,%20kotlin.String,%20android.os.Bundle))when there is an instantiation failure.

## Summary

|                                                                                                                                                                                     Public constructors                                                                                                                                                                                      ||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [InstantiationException](https://developer.android.com/reference/kotlin/android/app/Fragment.InstantiationException#InstantiationException(kotlin.String,%20java.lang.Exception))`(`msg:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `cause:` `[Exception](https://developer.android.com/reference/kotlin/java/lang/Exception.html#)!`)` <br /> |

## Public constructors

### InstantiationException

Added in[API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
InstantiationException(
    msg: String!, 
    cause: Exception!)
```