teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

6

文法の修正

2016/04/24 00:50

投稿

hamusuke1
hamusuke1

スコア12

title CHANGED
File without changes
body CHANGED
@@ -41,8 +41,8 @@
41
41
  LinearLayout layout = new LinearLayout(this);
42
42
  layout.setOrientation(LinearLayout.VERTICAL);
43
43
 
44
- setContentView(layout);
44
+ setContentView(layout); *ここの部分を削除すると正常に動くようになりました。
45
-
45
+
46
46
 
47
47
  myListView = (ListView)findViewById(R.id.itemListView);
48
48
 

5

ソースの追加

2016/04/24 00:50

投稿

hamusuke1
hamusuke1

スコア12

title CHANGED
File without changes
body CHANGED
@@ -40,6 +40,8 @@
40
40
 
41
41
  LinearLayout layout = new LinearLayout(this);
42
42
  layout.setOrientation(LinearLayout.VERTICAL);
43
+
44
+ setContentView(layout);
43
45
 
44
46
 
45
47
  myListView = (ListView)findViewById(R.id.itemListView);

4

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

2016/04/24 00:42

投稿

hamusuke1
hamusuke1

スコア12

title CHANGED
File without changes
body CHANGED
@@ -125,5 +125,40 @@
125
125
              at dalvik.system.NativeStart.main(Native Method)
126
126
 
127
127
  ```
128
+
129
+ ```java
130
+ activity_main3.xml
131
+
132
+ <?xml version="1.0" encoding="utf-8"?>
133
+
134
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
135
+ android:layout_width="match_parent"
136
+ android:layout_height="match_parent"
137
+ android:orientation="vertical" >
138
+
139
+ <ListView
140
+ android:layout_height="wrap_content"
141
+ android:id="@+id/itemListView"
142
+ android:layout_width="match_parent"
143
+ android:layout_weight="1"/>
144
+
145
+ <LinearLayout
146
+ android:layout_height="wrap_content"
147
+ android:layout_width="match_parent">
148
+
149
+ </LinearLayout>
150
+
151
+ <Button
152
+ android:id="@+id/deleteAll"
153
+ android:layout_width="match_parent"
154
+ android:layout_height="wrap_content"
155
+ android:text="全削除"
156
+ ></Button>
157
+
158
+ </LinearLayout>
159
+ ```
160
+
161
+
162
+
128
163
  Debuggerのスクショです
129
164
  ![Debuggerのスクショです](ff54a266a4ff520efefdecbc7d8987b3.png)

3

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

2016/04/22 13:05

投稿

hamusuke1
hamusuke1

スコア12

title CHANGED
File without changes
body CHANGED
@@ -10,6 +10,10 @@
10
10
 
11
11
 
12
12
  ```Java
13
+
14
+ Main3Activity.java↓
15
+
16
+
13
17
  import android.database.Cursor;
14
18
  import android.database.sqlite.SQLiteDatabase;
15
19
  import android.support.v7.app.AppCompatActivity;
@@ -78,27 +82,7 @@
78
82
 
79
83
  }
80
84
 
81
- @Override
85
+
82
- public boolean onCreateOptionsMenu(Menu menu) {
83
- // Inflate the menu; this adds items to the action bar if it is present.
84
- getMenuInflater().inflate(R.menu.menu_main3, menu);
85
- return true;
86
- }
87
-
88
- @Override
89
- public boolean onOptionsItemSelected(MenuItem item) {
90
- // Handle action bar item clicks here. The action bar will
91
- // automatically handle clicks on the Home/Up button, so long
92
- // as you specify a parent activity in AndroidManifest.xml.
93
- int id = item.getItemId();
94
-
95
- //noinspection SimplifiableIfStatement
96
- if (id == R.id.action_settings) {
97
- return true;
98
- }
99
-
100
- return super.onOptionsItemSelected(item);
101
- }
102
86
  }
103
87
  ```
104
88
 
@@ -141,27 +125,5 @@
141
125
              at dalvik.system.NativeStart.main(Native Method)
142
126
 
143
127
  ```
144
-
145
- ```java
146
- activity_main3に移る際ADBlogs↓
128
+ Debuggerスクショです
147
-
148
- ddms: Can't bind to local 8601 for debugger
149
- ddmlib: 確立された接続がホスト コンピューターのソウトウェアによって中止されました。
150
- java.io.IOException: 確立された接続がホスト コンピューターのソウトウェアによって中止されました。
151
- at sun.nio.ch.SocketDispatcher.write0(Native Method)
152
- at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:51)
153
- at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
154
- at sun.nio.ch.IOUtil.write(IOUtil.java:65)
155
- at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:471)
156
- at com.android.ddmlib.JdwpPacket.writeAndConsume(JdwpPacket.java:213)
157
- at com.android.ddmlib.Client.sendAndConsume(Client.java:684)
158
- at com.android.ddmlib.HandleHeap.sendREAQ(HandleHeap.java:349)
159
- at com.android.ddmlib.Client.requestAllocationStatus(Client.java:523)
160
- at com.android.ddmlib.DeviceMonitor.createClient(DeviceMonitor.java:847)
161
- at com.android.ddmlib.DeviceMonitor.openClient(DeviceMonitor.java:815)
162
- at com.android.ddmlib.DeviceMonitor.deviceClientMonitorLoop(DeviceMonitor.java:633)
163
- at com.android.ddmlib.DeviceMonitor.access$100(DeviceMonitor.java:46)
164
- at com.android.ddmlib.DeviceMonitor$3.run(DeviceMonitor.java:592)
165
- ```
166
-
167
129
  ![Debuggerのスクショです](ff54a266a4ff520efefdecbc7d8987b3.png)

2

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

2016/04/22 09:36

投稿

hamusuke1
hamusuke1

スコア12

title CHANGED
File without changes
body CHANGED
@@ -102,9 +102,11 @@
102
102
  }
103
103
  ```
104
104
 
105
+ ```java
105
106
  activity_main3に移る際の
106
107
  logcat↓
107
108
 
109
+
108
110
  04-22 14:52:09.370 28578-28578/com.example.sample.liflogaplicationtukurinaosi W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x41fc7ba8)
109
111
  04-22 14:52:09.370 28578-28578/com.example.sample.liflogaplicationtukurinaosi E/AndroidRuntime﹕ FATAL EXCEPTION: main
110
112
  Process: com.example.sample.liflogaplicationtukurinaosi, PID: 28578
@@ -138,6 +140,9 @@
138
140
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
139
141
              at dalvik.system.NativeStart.main(Native Method)
140
142
 
143
+ ```
144
+
145
+ ```java
141
146
  activity_main3に移る際のADBlogs↓
142
147
 
143
148
  ddms: Can't bind to local 8601 for debugger
@@ -156,4 +161,7 @@
156
161
  at com.android.ddmlib.DeviceMonitor.openClient(DeviceMonitor.java:815)
157
162
  at com.android.ddmlib.DeviceMonitor.deviceClientMonitorLoop(DeviceMonitor.java:633)
158
163
  at com.android.ddmlib.DeviceMonitor.access$100(DeviceMonitor.java:46)
159
- at com.android.ddmlib.DeviceMonitor$3.run(DeviceMonitor.java:592)
164
+ at com.android.ddmlib.DeviceMonitor$3.run(DeviceMonitor.java:592)
165
+ ```
166
+
167
+ ![Debuggerのスクショです](ff54a266a4ff520efefdecbc7d8987b3.png)

1

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

2016/04/22 07:56

投稿

hamusuke1
hamusuke1

スコア12

title CHANGED
File without changes
body CHANGED
@@ -7,9 +7,9 @@
7
7
  問題が発生したため(アプリ名)を終了します。
8
8
  となります。
9
9
 
10
- Main3Activityの
11
- ソース↓
12
10
 
11
+
12
+ ```Java
13
13
  import android.database.Cursor;
14
14
  import android.database.sqlite.SQLiteDatabase;
15
15
  import android.support.v7.app.AppCompatActivity;
@@ -100,6 +100,7 @@
100
100
  return super.onOptionsItemSelected(item);
101
101
  }
102
102
  }
103
+ ```
103
104
 
104
105
  activity_main3に移る際の
105
106
  logcat↓