Handle display of string or string resource

59 Views Asked by At

Suppose you apply the following architecture in your Android project: View - ViewModel - UseCase - Repository and you have to display some text from the UseCase layer to the View layer. However, this text some times is of type String and some times is of type Int (stringResource).

What is the best practice to handle this?

1

There are 1 best solutions below

0
Andi Tenroaji Ahmad On

Maybe you can try type Any and set case to decalre type as String || as Int