我正在开发一个基于问题和答案的应用程序。我的页面中的搜索选项
我使用RES /原始数据库获取数据, 我打算对IE浏览器的搜索选项, 我一直在底部的搜索框,说我有100个问题, 我想要做的事通过在搜索框中输入数字来转到问题45。 我没有任何想法在这方面的工作。 请帮我找到一个解决方案
protected void loadQuestionset1() throws Exception {
try {
InputStream questionset1 = this.getBaseContext().getResources()
.openRawResource(R.raw.questionset1);
bReader = new BufferedReader(new InputStreamReader(questionset1));
StringBuilder quesString = new StringBuilder();
String aJsonLine = null;
while ((aJsonLine = bReader.readLine()) != null) {
quesString.append(aJsonLine);
}
Log.d(this.getClass().toString(), quesString.toString());
JSONObject quesObj = new JSONObject(quesString.toString());
quesList1 = quesObj.getJSONArray("Questions");
Log.d(this.getClass().getName(),
"Num Questions " + quesList1.length());
}
catch (Exception e){
} finally {
try {
bReader.close();
} catch (Exception e) {
Log.e("", e.getMessage().toString(), e.getCause());
}
}
}
public static JSONArray getQuesList1() {
return quesList1;
}
编写您自己的搜索代码。得到第45个问题的数据并显示。 – Raghunandan