Correct way to implement newInstance of Fragment in Kotlin

--

As we know kotlin provide us numerous benefits to write code.

Here I am try to provide a best way to create new Instance of fragment using some benefits of kotlin language like scope function.

In generally we write newInstance of fragment like below.

simple way to make fragment new instance

Using kotlin we can reduce code like below.

Thank you.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Hitesh Dhamshaniya
Hitesh Dhamshaniya

No responses yet

Write a response