質問編集履歴

6

文法の修正

2016/04/24 00:50

投稿

hamusuke1
hamusuke1

スコア12

test CHANGED
File without changes
test CHANGED
@@ -84,28 +84,28 @@
84
84
 
85
85
 
86
86
 
87
- setContentView(layout);
87
+ setContentView(layout); *ここの部分を削除すると正常に動くようになりました。
88
+
89
+
90
+
91
+
92
+
93
+ myListView = (ListView)findViewById(R.id.itemListView);
94
+
95
+
96
+
97
+ MyOpenHelper helper = new MyOpenHelper(this);
88
98
 
89
99
 
90
100
 
91
-
92
-
93
- myListView = (ListView)findViewById(R.id.itemListView);
101
+ SQLiteDatabase db = helper.getReadableDatabase();
94
-
95
-
96
-
102
+
103
+
104
+
97
- MyOpenHelper helper = new MyOpenHelper(this);
105
+ Cursor c = db.rawQuery
98
106
 
99
107
 
100
108
 
101
- SQLiteDatabase db = helper.getReadableDatabase();
102
-
103
-
104
-
105
- Cursor c = db.rawQuery
106
-
107
-
108
-
109
109
  //表示するカラム名
110
110
 
111
111
  String[] from = {"Shopname","_id"};

5

ソースの追加

2016/04/24 00:50

投稿

hamusuke1
hamusuke1

スコア12

test CHANGED
File without changes
test CHANGED
@@ -82,6 +82,10 @@
82
82
 
83
83
  layout.setOrientation(LinearLayout.VERTICAL);
84
84
 
85
+
86
+
87
+ setContentView(layout);
88
+
85
89
 
86
90
 
87
91
 

4

xmlファイルの追加を行いました

2016/04/24 00:42

投稿

hamusuke1
hamusuke1

スコア12

test CHANGED
File without changes
test CHANGED
@@ -252,6 +252,76 @@
252
252
 
253
253
  ```
254
254
 
255
+
256
+
257
+ ```java
258
+
259
+ activity_main3.xml
260
+
261
+
262
+
263
+ <?xml version="1.0" encoding="utf-8"?>
264
+
265
+
266
+
267
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
268
+
269
+ android:layout_width="match_parent"
270
+
271
+ android:layout_height="match_parent"
272
+
273
+ android:orientation="vertical" >
274
+
275
+
276
+
277
+ <ListView
278
+
279
+ android:layout_height="wrap_content"
280
+
281
+ android:id="@+id/itemListView"
282
+
283
+ android:layout_width="match_parent"
284
+
285
+ android:layout_weight="1"/>
286
+
287
+
288
+
289
+ <LinearLayout
290
+
291
+ android:layout_height="wrap_content"
292
+
293
+ android:layout_width="match_parent">
294
+
295
+
296
+
297
+ </LinearLayout>
298
+
299
+
300
+
301
+ <Button
302
+
303
+ android:id="@+id/deleteAll"
304
+
305
+ android:layout_width="match_parent"
306
+
307
+ android:layout_height="wrap_content"
308
+
309
+ android:text="全削除"
310
+
311
+ ></Button>
312
+
313
+
314
+
315
+ </LinearLayout>
316
+
317
+ ```
318
+
319
+
320
+
321
+
322
+
323
+
324
+
255
325
  Debuggerのスクショです
256
326
 
257
327
  ![Debuggerのスクショです](ff54a266a4ff520efefdecbc7d8987b3.png)

3

コードの追加を行いました!文字数の関係で一部削除いたしました。

2016/04/22 13:05

投稿

hamusuke1
hamusuke1

スコア12

test CHANGED
File without changes
test CHANGED
@@ -22,6 +22,14 @@
22
22
 
23
23
  ```Java
24
24
 
25
+
26
+
27
+ Main3Activity.java↓
28
+
29
+
30
+
31
+
32
+
25
33
  import android.database.Cursor;
26
34
 
27
35
  import android.database.sqlite.SQLiteDatabase;
@@ -158,47 +166,7 @@
158
166
 
159
167
 
160
168
 
161
- @Override
169
+
162
-
163
- public boolean onCreateOptionsMenu(Menu menu) {
164
-
165
- // Inflate the menu; this adds items to the action bar if it is present.
166
-
167
- getMenuInflater().inflate(R.menu.menu_main3, menu);
168
-
169
- return true;
170
-
171
- }
172
-
173
-
174
-
175
- @Override
176
-
177
- public boolean onOptionsItemSelected(MenuItem item) {
178
-
179
- // Handle action bar item clicks here. The action bar will
180
-
181
- // automatically handle clicks on the Home/Up button, so long
182
-
183
- // as you specify a parent activity in AndroidManifest.xml.
184
-
185
- int id = item.getItemId();
186
-
187
-
188
-
189
- //noinspection SimplifiableIfStatement
190
-
191
- if (id == R.id.action_settings) {
192
-
193
- return true;
194
-
195
- }
196
-
197
-
198
-
199
- return super.onOptionsItemSelected(item);
200
-
201
- }
202
170
 
203
171
  }
204
172
 
@@ -284,50 +252,6 @@
284
252
 
285
253
  ```
286
254
 
287
-
288
-
289
- ```java
290
-
291
- activity_main3に移る際のADBlogs↓
255
+ Debuggerのスクショです
292
-
293
-
294
-
295
- ddms: Can't bind to local 8601 for debugger
296
-
297
- ddmlib: 確立された接続がホスト コンピューターのソウトウェアによって中止されました。
298
-
299
- java.io.IOException: 確立された接続がホスト コンピューターのソウトウェアによって中止されました。
300
-
301
- at sun.nio.ch.SocketDispatcher.write0(Native Method)
302
-
303
- at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:51)
304
-
305
- at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
306
-
307
- at sun.nio.ch.IOUtil.write(IOUtil.java:65)
308
-
309
- at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:471)
310
-
311
- at com.android.ddmlib.JdwpPacket.writeAndConsume(JdwpPacket.java:213)
312
-
313
- at com.android.ddmlib.Client.sendAndConsume(Client.java:684)
314
-
315
- at com.android.ddmlib.HandleHeap.sendREAQ(HandleHeap.java:349)
316
-
317
- at com.android.ddmlib.Client.requestAllocationStatus(Client.java:523)
318
-
319
- at com.android.ddmlib.DeviceMonitor.createClient(DeviceMonitor.java:847)
320
-
321
- at com.android.ddmlib.DeviceMonitor.openClient(DeviceMonitor.java:815)
322
-
323
- at com.android.ddmlib.DeviceMonitor.deviceClientMonitorLoop(DeviceMonitor.java:633)
324
-
325
- at com.android.ddmlib.DeviceMonitor.access$100(DeviceMonitor.java:46)
326
-
327
- at com.android.ddmlib.DeviceMonitor$3.run(DeviceMonitor.java:592)
328
-
329
- ```
330
-
331
-
332
256
 
333
257
  ![Debuggerのスクショです](ff54a266a4ff520efefdecbc7d8987b3.png)

2

スタイルの変更、スクショを追加しました

2016/04/22 09:36

投稿

hamusuke1
hamusuke1

スコア12

test CHANGED
File without changes
test CHANGED
@@ -206,12 +206,16 @@
206
206
 
207
207
 
208
208
 
209
+ ```java
210
+
209
211
  activity_main3に移る際の
210
212
 
211
213
  logcat↓
212
214
 
213
215
 
214
216
 
217
+
218
+
215
219
  04-22 14:52:09.370 28578-28578/com.example.sample.liflogaplicationtukurinaosi W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x41fc7ba8)
216
220
 
217
221
  04-22 14:52:09.370 28578-28578/com.example.sample.liflogaplicationtukurinaosi E/AndroidRuntime﹕ FATAL EXCEPTION: main
@@ -278,6 +282,12 @@
278
282
 
279
283
 
280
284
 
285
+ ```
286
+
287
+
288
+
289
+ ```java
290
+
281
291
  activity_main3に移る際のADBlogs↓
282
292
 
283
293
 
@@ -315,3 +325,9 @@
315
325
  at com.android.ddmlib.DeviceMonitor.access$100(DeviceMonitor.java:46)
316
326
 
317
327
  at com.android.ddmlib.DeviceMonitor$3.run(DeviceMonitor.java:592)
328
+
329
+ ```
330
+
331
+
332
+
333
+ ![Debuggerのスクショです](ff54a266a4ff520efefdecbc7d8987b3.png)

1

Javaの書式に変更しました!

2016/04/22 07:56

投稿

hamusuke1
hamusuke1

スコア12

test CHANGED
File without changes
test CHANGED
@@ -16,11 +16,11 @@
16
16
 
17
17
 
18
18
 
19
+
20
+
21
+
22
+
19
- Main3Activityの
23
+ ```Java
20
-
21
- ソース↓
22
-
23
-
24
24
 
25
25
  import android.database.Cursor;
26
26
 
@@ -202,6 +202,8 @@
202
202
 
203
203
  }
204
204
 
205
+ ```
206
+
205
207
 
206
208
 
207
209
  activity_main3に移る際の