Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
273 views
in Technique[技术] by (71.8m points)

java - 字符串在Android Studio中无法正常工作(String Is Not Working Properly In Android studio)

     String body = "lat: 33.584317N long: 73.045458";
     String data = body;
     String[] args = data.split(" ");
     Log.d("Args",""+number); // Output 098765432
     Log.d("Args"," "+data); // output lat: 33.584317N long: 73.045458
     Log.d("Args",args[1]); // give 33.584317```

> But Down one This Do Not Work Plz Help Me With This Code i dont know Its a bug or not
String body = cursor.getString(cursor.getColumnIndexOrThrow("body")).toString();
String number = "098765432";
String data = body;
String[] args = data.split(" ");
Log.d("Args",body); // Output lat: 33.584317N long: 73.045458
Log.d("Args",args[0]); // Output lat:
Log.d("Args",args[1]); // Gives Error https://pastebin.com/YjRnfG4n ```

I am Trying to get get this "33.584317N" String Is Not Working Properly In Android studio in java error java.lang.ArrayIndexOutOfBoundsException: length=1;

(我正在尝试获取此“ 33.584317N”字符串在Android Studio中的Java中无法正常工作,错误java.lang.ArrayIndexOutOfBoundsException: length = 1;)

index=1 Plz Help ME!

(index = 1请帮助我!)

  ask by webdown translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...