Menu
Newbedev LogoNEWBEDEV Python Javascript Linux Cheat sheet
Newbedev LogoNEWBEDEV
  • Python 1
  • Javascript
  • Linux
  • Cheat sheet
  • Contact

Getting simpleName() after getClass() in Kotlin

Use someObject::class.java.simpleName.


There is couple ways to do this in Kotlin You can receive the name via property - KClass.qualifiedName

val name = AClass::class.qualifiedName;

or through the Class.getName

val name = AClass::class.java.getName();

or you can try with Class.name

val name = AClass::class.java.name;

or Class.canonicalName

var name = AClass::class.java.canonicalName as String

Tags:

Java

String

Android

Kotlin

Related

Set-AzContext works in Azure Cloud Shell but doesn't in Azure PowerShell Encode String to UTF-8 in Kotlin Symfony form: Uploaded file - "This value should be of type string" Azure function app deploy and release pipeline error How to use Spark Streaming to read a stream and find the IP over a time Window? SwiftUI dynamic List with Sections does not Layout correctly Angular Material mat-label accessibility How to graph tf.keras model in Tensorflow-2.0? Vuetify - How to highlight row on click in v-data-table How to setup a vue-cli with vuetify project to run with IE 11? Can a Swift Property Wrapper reference the owner of the property its wrapping? SwiftUI @Binding Initialize

Recent Posts

Pandas how to find column contains a certain value Recommended way to install multiple Python versions on Ubuntu 20.04 Build super fast web scraper with Python x100 than BeautifulSoup How to convert a SQL query result to a Pandas DataFrame in Python How to write a Pandas DataFrame to a .csv file in Python
© 2021 newbedevPrivacy Policy