Skip to content
Advertisement

Get string line by line android programmatically

I have this code but the problem is that this continually showing toast of each string line when I pressed my desired button.

Like this:

Clicked the button once:

Toast shows continually:

A

B

C

What I want is to get string from a single line once I click the button.

Like this:

EditText value: A

B

C

Result first click:

A only

Result second click:

B only

Result third click:

C only

Like that

Btw this is the code I use:

JavaScript

I know it’s hard to understand but please bare with me.

Advertisement

Answer

I think you can go for an approach like this.

JavaScript

Just enter a value in the editText when the value is reset after a single button click.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement