Dezo
Dezo

Reputation: 871

Where is a checkbox "include interface callbacks" when you want to create new fragment in android studio 3.6.3

I just upgraded my android studio at 3.6.3 version and I started to watch some Udemy course about Kotlin programming and I noticed when I tried to create new Fragment I didn't see a checkbox "include interface callbacks" as in old version in Android studio. I am a beginner in Kotlin so I need some advice.

Here is an example of fragment creation in the new Android studio: enter image description here

Here is in some old version: enter image description here

How can I include interface callbacks in the new version of the Android studio automatically? I hope I don't need to do it all manually, maybe some shortcut option?

Upvotes: 3

Views: 189

Answers (1)

Dezo
Dezo

Reputation: 871

I investigated and I found out that interface callbacks for communication between fragments and fragments with activity are now maintained with the use of ViewModel class which is much easier than using all that code with interface callbacks.

Second good option for such communication is the use of third-party libraries like RxJava. Means guys from Google and JetBrains removed that option and now is available option to create ViewModel class within Fragment through File -> New -> Fragment -> Fragment(with ViewModel).

Upvotes: 0

Related Questions