質問と回答に基づいたアプリを開発しています。
res/raw データベースを使用してデータを取得しています。そのための検索オプションを用意する予定です。つまり、検索ボックスを一番下に置いて、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;
}