我正在開發一個基於問題和答案的應用程序。我的頁面中的搜索選項
我使用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