2

How to Display text file (.txt) in jetpack compose.

Explanation:

Need to show (.txt) file on the screen using Jetpack compose

Tippu Fisal Sheriff
  • 2,177
  • 11
  • 19

1 Answers1

1

Just read text into some value

val text = File("example.txt").readText()

Thus, all text from your file will be in that string value.

And create @Composable text function with this value

@Composable    
Text(text = text)
Merkost
  • 1,251
  • 9
  • 16