# readLine does not work (returns null)

**URL:** <https://discuss.kotlinlang.org/t/readline-does-not-work-returns-null/21488>\
**Category:** Android\
**Created:** [April 9, 2021, 3:47pm UTC](https://discuss.kotlinlang.org/t/readline-does-not-work-returns-null/21488 "2021-04-09T15:47:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![brunoramos.u](https://avatars.discourse-cdn.com/v4/letter/b/3e96dc/32.png) [@brunoramos.u](https://discuss.kotlinlang.org/u/brunoramos.u)\
**Post date:** [April 9, 2021, 3:47pm UTC](https://discuss.kotlinlang.org/t/readline-does-not-work-returns-null/21488/1 "2021-04-09T15:47:06Z")

</div>

Hi guys, I’m learning Kotlin and I want to do a calculator. The problem happen when I want to get information for the console with the code “readLine”. In my System.out appear a value “null”. Like in the picture.

 ![1](https://us1.discourse-cdn.com/flex019/uploads/kotlinlang/original/2X/8/8d5a671ead8358fdc659a781435a790e91f8f888.jpeg)

This is my code

package com.example.calculadora

import androidx.appcompat.app.AppCompatActivity  
import android.os.Bundle

class MainActivity : AppCompatActivity() {  
override fun onCreate(savedInstanceState: Bundle?) {  
super.onCreate(savedInstanceState)  
setContentView(R.layout.activity\_main)

```
    var numero = readLine()
    println(numero)

}

```

}

---

<div class="post-metadata">

**Author:** ![al3c](https://avatars.discourse-cdn.com/v4/letter/a/e47774/32.png) [@al3c](https://discuss.kotlinlang.org/u/al3c)\
**Post date:** [April 9, 2021, 5:06pm UTC](https://discuss.kotlinlang.org/t/readline-does-not-work-returns-null/21488/2 "2021-04-09T17:06:07Z")

</div>

Your code is that of an android activity. Android has no terminal where you can type things.  
If you’re learning just kotlin start without touching android.
