Android studio question: cannot resolve "nextLine() method.
I am trying to use a java program I wrote in android studio. The program ran in java but android studio doesn't recognize the nextLine () method in the for loop to parse my input into 3 ints. Any tips would be appreciated. import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import java.util.Scanner; import java.util.ArrayList; import java.util.List; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button addBtn = (Button) findViewById(R.id.addBtn); addBtn.setOnClickListener (new View.OnClickListener() { @Override public void onClick(View v) { EditText rawinput = (EditText) findViewById(R.id.rawinput); TextView result = (TextView) findViewById(R.id.result); List<Integer> arraynumbers = new ArrayList<>(); // creates an ArrayList called arraynumbers made of integers for(String num: rawinput.nextLine().split("-")) {// for loop to take the numbers between "-" in rawinput arraynumbers.add(Integer.parseInt(num)); // and add them to the ArrayList "arraynumbers" as Integers } // converts pair # to ccpt if(arraynumbers.size() == 1) { // if there is only one int in arraynumbers then do this stuff int a = (arraynumbers.get(0)); // user input of arraynumbers assigned to variable "a" int px = (a % 150); // uses "a" +math to return pair number in bank & assign to variable "px" double sx = (px - .5) / 6; // uses "px" +math to return slot # in double format &