我使用此代码阅读行:
Scanner inputReader = new Scanner(System.in);
String line = inputReader.nextLine();
while (!"exit".equals(line)) {
//Some codes...
line = inputReader.next();
}
inputReader.close();
但是,我收到了这个错误:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.signalrclient/com.example.signalrclient.MainActivity}: java.util.NoSuchElementException