Yes, you can. You can call Kotlin function with Java and you also can call Java function with Kotlin. But you must write kotlin code in .kt file and write Java code in .java file.
More Related Contents:
- Translate java widget to kotlin [duplicate]
- Formatting Double to String? [duplicate]
- Unfortunately MyApp has stopped. How can I solve this?
- Why does my function that calls an API return an empty or null value?
- Alarm Manager Example
- How to launch an Activity from another Application in Android
- How to allow all Network connection types HTTP and HTTPS in Android (9) Pie?
- The AsyncTask API is deprecated in Android 11. What are the alternatives?
- How to make an Android device vibrate? with different frequency?
- How can I generate random number in specific range in Android? [duplicate]
- What do I use now that Handler() is deprecated?
- Why does my function that calls an API or launches a coroutine return an empty or null value?
- android:exported needs to be explicitly specified for . Apps targeting Android 12 and higher are required to specify
- onActivityResult() not called in new nested fragment API
- Android room persistent: AppDatabase_Impl does not exist
- JCenter deprecation; impact on Gradle and Android
- Android Get Current timestamp?
- How to save an image in Android Q using MediaStore?
- How to check permission in fragment
- Room – Schema export directory is not provided to the annotation processor so we cannot export the schema
- Android calculate days between two dates
- unrecognized Attribute name MODULE (class com.sun.tools.javac.util.SharedNameTable$NameImpl)
- How to exclude an element from a Firestore query?
- Kotlin-android: unresolved reference databinding
- What is the best way to declare on UI component in android with Kotlin?
- Android Failed to instantiate one or more classes
- MediaSessionCompat:Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent
- How I can use callback in Kotlin?
- Duplicate class in Kotlin Android
- How to hide the soft keyboard inside a fragment?