質問編集履歴

2

誤字

2017/04/04 11:20

投稿

edoooooo
edoooooo

スコア476

test CHANGED
File without changes
test CHANGED
@@ -330,21 +330,25 @@
330
330
 
331
331
  );
332
332
 
333
+
334
+
335
+ if(cursor.moveToFirst()){
336
+
337
+ do{
338
+
339
+ adapter.add(String.valueOf(cursor.getInt(0)) + ":" +cursor.getString(1));
340
+
333
- while (cursor.moveToNext()) {
341
+ }while(cursor.moveToNext());
334
-
335
- adapter.add(String.valueOf(cursor.getInt(0)));
342
+
336
-
337
- adapter.add(cursor.getString(1));
343
+ }
338
-
344
+
339
- memolist.setAdapter(adapter);
345
+ memolist.setAdapter(adapter);
340
-
341
- //終了処理
346
+
342
-
343
- cursor.close();
347
+ cursor.close();
344
-
348
+
345
- sdb.close();
349
+ sdb.close();
346
-
347
- }
350
+
351
+
348
352
 
349
353
  }
350
354
 

1

コードの変更

2017/04/04 11:20

投稿

edoooooo
edoooooo

スコア476

test CHANGED
File without changes
test CHANGED
@@ -274,7 +274,23 @@
274
274
 
275
275
 
276
276
 
277
+ // DBから取得部分
278
+
277
- Cursor cursor = sdb.query("reportmemo", null, null, null, null, null, null);
279
+ Cursor cursor = sdb.query("Memo",
280
+
281
+ new String[]{"content","memo"},
282
+
283
+ null,
284
+
285
+ null,
286
+
287
+ null,
288
+
289
+ null,
290
+
291
+ "content ASC");
292
+
293
+
278
294
 
279
295
 
280
296