gpt4 book ai didi

android - 无法正确打印字符串

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:11:57 26 4
gpt4 key购买 nike

我想在 EditText 中获取带有答案的整个字符串。但我只得到最后一个问题。可能是因为它正在覆盖值。谁能帮帮我。

      String question[]={
"Is the condition of the security post organized and clean?",
"Is the officer aware of the U.S. Security ISO 9001:2008 Quality Program?",
"Does the officer have a security officer guidebook?",
"Does the officer have a current, valid security guard license?",
"Are the post orders complete?",
"Are the security officer key goals included in the post orders?",
"Is there a client emergency list of phone numbers?",
"Has the officer signed off that he/she read and understands the post orders",
"Has the officer received US Security Academy training or state mandated training?",
"Has the officer received site specific training?",
"If the officer drives a vehicle on duty, does he/she have a verified valid drivers license?",
"Is the officer in proper uniform?",
"Does the officer know the client contact?",
"Does the officer know how to contact his/her supervisor?",
"Is the site on Post Positive?",
"Is the officer trained and knowledgeable on the use of Post Positive?",
"Are the daily activity reports up to date?",
"Did the inspecting supervisor sign daily activity reports indicating date and time of inspection?",
"Does the security officer have any safety or security concerns regarding this client location?",
};
for(int i=0;i<19;i++)
{
//summ+=summ;
s=sq[i].split("&");


summ=question[i]+" "+s[0];
//Toast.makeText(getApplicationContext(),summ, Toast.LENGTH_LONG).show();
mQuestions.setText(summ);
}

最佳答案

第一个解决方案:

使用EditText.append用于向 EditText 中的现有文本添加新字符串

 mQuestions.append(summ);

代替

 mQuestions.setText(summ);

第二种解决方案:

String summ="";
for(int i=0;i<19;i++)
{
//summ+=summ;
s=sq[i].split("&");

summ +=question[i]+" "+s[0];

mQuestions.setText(summ);
}

关于android - 无法正确打印字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14004133/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com