我在想,我可以从两个AutoCompleteTextView
中获取用户输入,并将其显示为TableLayout
。字符串数组:显示结果
两个输入该AutoCompleteTextView
需要的是我的位置和目标从用户。复杂性来自AutoCompleteTextView
生成的输入类型。 AutoCompleteTextView
使用Google的PlacesAutoComplete
,因此我正在使用像Jamal,加德满都,中部地区,尼泊尔和也许Kalanki,加德满都,中部地区,尼泊尔。我想在TableLayout
反映是结果:从...到...
我的问题是如何才能采取字符串的第一部分中贾马尔,加德满都,中部地区,尼泊尔这只是Jamal为TableLayout
显示结果如结果:从Jamal到Kalanki。对android来说很新颖我有点含糊不清,我试过的代码看起来像这样。
String[] from;
String[] to;
//pulling the auto complete text view
from = location.getString().toText();
to = destination.getString().toText();
//referencing the text view inside the table layout
results.setText(new StringBuilder().append("Results from"+from[0]).append(" to"+to[0]));
此代码明显,因为它促使我改变from
到String
不起作用。我真的不知道发生了什么事。请帮忙 ?
不知道这些数组声明是做什么的,但它们不会编译。 – Keppil 2013-04-11 06:50:31
谢谢,我编辑了我的答案 – jimpanzer 2013-04-11 06:51:55
@Keppil,感谢您指出了错误。 – jimpanzer 2013-04-11 06:58:22