StackOverflow Questions for Tag: kotlin-companion

Bass
Bass

Reputation: 5348

Implementing a factory via the invoke() function of a companion object at the top of a sealed hierarchy

Score: 1

Views: 103

Answers: 0

Read More
testivanivan
testivanivan

Reputation: 1514

How to use kotlin value class from java code?

Score: 1

Views: 444

Answers: 1

Read More
Lotexiu
Lotexiu

Reputation: 1

How to pass Class.Companion as a parameter

Score: 0

Views: 41

Answers: 0

Read More
Anm
Anm

Reputation: 3361

object instances in companion objects

Score: 2

Views: 1348

Answers: 2

Read More
goshki
goshki

Reputation: 130

Kotlin: cannot use const val from companion object in an outer enum class

Score: 2

Views: 1658

Answers: 2

Read More
CodingBruceLee
CodingBruceLee

Reputation: 1069

How to get packageName in companion object?

Score: 0

Views: 158

Answers: 2

Read More
Elye
Elye

Reputation: 60341

Can I add companion extension without first having companion object within a class?

Score: 2

Views: 350

Answers: 1

Read More
Diken Mhrz
Diken Mhrz

Reputation: 460

Does cancelling a coroutine cancel the write to a file?

Score: 0

Views: 222

Answers: 0

Read More
TooManyEduardos
TooManyEduardos

Reputation: 4444

Why and when to use @JvmStatic with companion objects?

Score: 125

Views: 71910

Answers: 5

Read More
sluzzle dude
sluzzle dude

Reputation: 3

cant understand this kotlin companion object code

Score: 0

Views: 49

Answers: 1

Read More
testivanivan
testivanivan

Reputation: 1514

Kotlin. How to check if value is in range?

Score: 0

Views: 2926

Answers: 2

Read More
Dhaval
Dhaval

Reputation: 2884

How to access function of companion object using class object in Kotlin?

Score: 0

Views: 2601

Answers: 0

Read More
Evans Kiptarus Kibet
Evans Kiptarus Kibet

Reputation: 194

Call another function or variable inside a companion object android kotlin from main thread

Score: 0

Views: 961

Answers: 1

Read More
Will Chen
Will Chen

Reputation: 603

Why can I not access `::class.companionObject`?

Score: 1

Views: 1334

Answers: 1

Read More
c-an
c-an

Reputation: 4120

Is using companion object in activity and application class a good way?

Score: 0

Views: 1955

Answers: 2

Read More
Saurabh Dhage
Saurabh Dhage

Reputation: 1711

Why Companion object is not accessible from Java code?

Score: 0

Views: 1848

Answers: 3

Read More

Why do we use "companion object" as a kind of replacement for Java static fields in Kotlin?

Score: 200

Views: 67323

Answers: 5

Read More
Eitanos30
Eitanos30

Reputation: 1439

Is it possible to extends a class that has a non empty constructor with a companion object

Score: 2

Views: 206

Answers: 2

Read More
galaxigirl
galaxigirl

Reputation: 2550

Variable in base class is null when initialized from derived class but called from super

Score: 1

Views: 262

Answers: 1

Read More
Jakob
Jakob

Reputation: 151

How to override inherited getter from java class in a kotlin companion object

Score: 0

Views: 341

Answers: 1

Read More
PreviousPage 1Next