質問編集履歴
3
問題の修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -20,7 +20,7 @@
|
|
20
20
|
|
21
21
|
|
22
22
|
|
23
|
-
|
23
|
+
RecyclerViewに何も表示されない。(ビルドはできる)
|
24
24
|
|
25
25
|
ブレークポイントを設置してデバッグしてみましたが、特に問題は確認できませんでした。
|
26
26
|
|
2
説明の追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -58,6 +58,18 @@
|
|
58
58
|
|
59
59
|
追記 2019/9/11
|
60
60
|
|
61
|
+
|
62
|
+
|
63
|
+
プロジェクトを作成しなおして実行したところ、
|
64
|
+
|
65
|
+
アプリが落ちることはありませんでしたが、
|
66
|
+
|
67
|
+
何も表示されていないRecyclerViewが表示されました。
|
68
|
+
|
69
|
+
その際の実行ログになります。
|
70
|
+
|
71
|
+
|
72
|
+
|
61
73
|
- 実行時ログ
|
62
74
|
|
63
75
|
```
|
1
ソースの記載
test
CHANGED
File without changes
|
test
CHANGED
@@ -52,82 +52,342 @@
|
|
52
52
|
|
53
53
|
|
54
54
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
55
|
+
|
56
|
+
|
57
|
+
---
|
58
|
+
|
59
|
+
追記 2019/9/11
|
60
|
+
|
61
|
+
- 実行時ログ
|
62
|
+
|
63
|
+
```
|
64
|
+
|
65
|
+
09/11 13:34:53: Launching app
|
66
|
+
|
67
|
+
$ adb shell am start -n "com.example.testapp/com.example.testapp.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
|
68
|
+
|
69
|
+
Connected to process 14163 on device huawei-ale_l02-ARC7N15716001377
|
70
|
+
|
71
|
+
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
|
72
|
+
|
73
|
+
D/HwCust: Create obj success use class android.content.res.HwCustHwResourcesImpl
|
74
|
+
|
75
|
+
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.example.testapp-1/split_lib_dependencies_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.example.testapp-1@split_lib_dependencies_apk.apk@classes.dex) because non-0 exit status
|
76
|
+
|
77
|
+
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.example.testapp-1/split_lib_slice_0_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.example.testapp-1@split_lib_slice_0_apk.apk@classes.dex) because non-0 exit status
|
78
|
+
|
79
|
+
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.example.testapp-1/split_lib_slice_9_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.example.testapp-1@split_lib_slice_9_apk.apk@classes.dex) because non-0 exit status
|
80
|
+
|
81
|
+
W/System: ClassLoader referenced unknown path: /data/app/com.example.testapp-1/lib/arm64
|
82
|
+
|
83
|
+
I/InstantRun: starting instant run server: is main process
|
84
|
+
|
85
|
+
W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter androidx.vectordrawable.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
|
86
|
+
|
87
|
+
D/HwCust: Create obj success use class android.content.res.HwCustHwResourcesImpl
|
88
|
+
|
89
|
+
V/HwPolicyFactory: : success to get AllImpl object and return....
|
90
|
+
|
91
|
+
V/HwWidgetFactory: : successes to get AllImpl object and return....
|
92
|
+
|
93
|
+
V/ActivityThread: ActivityThread,callActivityOnCreate
|
94
|
+
|
95
|
+
I/art: Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat$2>
|
96
|
+
|
97
|
+
I/art: Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat$2>
|
98
|
+
|
99
|
+
D/CubicBezierInterpolator: CubicBezierInterpolator mControlPoint1x = 0.15, mControlPoint1y = 0.7, mControlPoint2x = 0.2, mControlPoint2y = 0.98
|
100
|
+
|
101
|
+
D/CubicBezierInterpolator: CubicBezierInterpolator mControlPoint1x = 0.6, mControlPoint1y = 0.9, mControlPoint2x = 0.8, mControlPoint2y = 1.0
|
102
|
+
|
103
|
+
D/CubicBezierInterpolator: CubicBezierInterpolator mControlPoint1x = 0.15, mControlPoint1y = 0.7, mControlPoint2x = 0.2, mControlPoint2y = 0.98
|
104
|
+
|
105
|
+
D/CubicBezierInterpolator: CubicBezierInterpolator mControlPoint1x = 0.6, mControlPoint1y = 0.9, mControlPoint2x = 0.8, mControlPoint2y = 1.0
|
106
|
+
|
107
|
+
I/HwSecImmHelper: mSecurityInputMethodService is null
|
108
|
+
|
109
|
+
D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: false
|
110
|
+
|
111
|
+
E/HAL: load: id=gralloc != hmi->id=gralloc
|
112
|
+
|
113
|
+
V/ActivityThread: Resuming ActivityRecord{67ba0d9 token=android.os.BinderProxy@6484b52 {com.example.testapp/com.example.testapp.MainActivity}} with isForward=true,forwardBitChanged=false
|
114
|
+
|
115
|
+
V/ActivityThread: Resuming ActivityRecord{67ba0d9 token=android.os.BinderProxy@6484b52 {com.example.testapp/com.example.testapp.MainActivity}} with isForward=true,forwardBitChanged=false
|
116
|
+
|
117
|
+
E/HAL: load: id=gralloc != hmi->id=gralloc
|
118
|
+
|
119
|
+
I/OpenGLRenderer: Initialized EGL, version 1.4
|
120
|
+
|
121
|
+
W/OpenGLRenderer: load: so=/system/lib64/libhwuibp.so
|
122
|
+
|
123
|
+
dlopen failed: library "/system/lib64/libhwuibp.so" not found
|
124
|
+
|
125
|
+
Initialize Binary Program Cache: Load Failed
|
126
|
+
|
127
|
+
E/HAL: load: id=gralloc != hmi->id=gralloc
|
128
|
+
|
129
|
+
I/HwSecImmHelper: mSecurityInputMethodService is null
|
130
|
+
|
131
|
+
mSecurityInputMethodService is null
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
```
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
- item.java
|
60
140
|
|
61
141
|
```ここに言語を入力
|
62
142
|
|
143
|
+
public class item {
|
144
|
+
|
145
|
+
|
146
|
+
|
63
|
-
|
147
|
+
int background;
|
148
|
+
|
64
|
-
|
149
|
+
String profileName;
|
150
|
+
|
151
|
+
int profilePhoto;
|
152
|
+
|
153
|
+
int nbFollowers;
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
public item() {
|
158
|
+
|
159
|
+
}
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
public item(int background, String profileName, int profilePhoto, int nbFollowers) {
|
164
|
+
|
165
|
+
this.background = background;
|
166
|
+
|
167
|
+
this.profileName = profileName;
|
168
|
+
|
169
|
+
this.profilePhoto = profilePhoto;
|
170
|
+
|
171
|
+
this.nbFollowers = nbFollowers;
|
172
|
+
|
173
|
+
}
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
public int getBackground() {
|
178
|
+
|
179
|
+
return background;
|
180
|
+
|
181
|
+
}
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
public String getProfileName() {
|
186
|
+
|
187
|
+
return profileName;
|
188
|
+
|
189
|
+
}
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
public int getProfilePhoto() {
|
194
|
+
|
195
|
+
return profilePhoto;
|
196
|
+
|
197
|
+
}
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
public int getNbFollowers() {
|
202
|
+
|
203
|
+
return nbFollowers;
|
204
|
+
|
205
|
+
}
|
206
|
+
|
207
|
+
|
208
|
+
|
65
|
-
|
209
|
+
public void setBackground(int background) {
|
66
|
-
|
210
|
+
|
67
|
-
a
|
211
|
+
this.background = background;
|
68
|
-
|
212
|
+
|
69
|
-
|
213
|
+
}
|
70
|
-
|
71
|
-
|
214
|
+
|
72
|
-
|
73
|
-
|
215
|
+
|
74
|
-
|
216
|
+
|
75
|
-
|
217
|
+
public void setProfileName(String profileName) {
|
218
|
+
|
76
|
-
|
219
|
+
this.profileName = profileName;
|
220
|
+
|
221
|
+
}
|
222
|
+
|
223
|
+
|
224
|
+
|
77
|
-
|
225
|
+
public void setProfilePhoto(int profilePhoto) {
|
226
|
+
|
78
|
-
|
227
|
+
this.profilePhoto = profilePhoto;
|
228
|
+
|
229
|
+
}
|
230
|
+
|
231
|
+
|
232
|
+
|
79
|
-
|
233
|
+
public void setNbFollowers(int nbFollowers) {
|
234
|
+
|
80
|
-
|
235
|
+
this.nbFollowers = nbFollowers;
|
236
|
+
|
237
|
+
}
|
238
|
+
|
239
|
+
}
|
240
|
+
|
81
|
-
```
|
241
|
+
```
|
82
|
-
|
242
|
+
|
83
|
-
|
243
|
+
- Adapter.java
|
84
244
|
|
85
245
|
```ここに言語を入力
|
86
246
|
|
247
|
+
public class Adapter extends RecyclerView.Adapter<Adapter.myViewHolder> {
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
Context mContext;
|
252
|
+
|
253
|
+
List<item> mData;
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
public Adapter(Context mContext, List<item> mData) {
|
258
|
+
|
259
|
+
this.mContext = mContext;
|
260
|
+
|
261
|
+
this.mData = mData;
|
262
|
+
|
263
|
+
}
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
@NonNull
|
268
|
+
|
269
|
+
@Override
|
270
|
+
|
271
|
+
public myViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
LayoutInflater inflater = LayoutInflater.from(mContext);
|
276
|
+
|
277
|
+
View v = inflater.inflate(R.layout.card_item,parent,false);
|
278
|
+
|
279
|
+
return new myViewHolder(v);
|
280
|
+
|
281
|
+
}
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
@Override
|
286
|
+
|
287
|
+
public void onBindViewHolder(@NonNull myViewHolder holder, int position) {
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
holder.background_img.setImageResource(mData.get(position).getBackground());
|
292
|
+
|
293
|
+
holder.profile_photo.setImageResource(mData.get(position).getProfilePhoto());
|
294
|
+
|
295
|
+
holder.tv_title.setText(mData.get(position).getProfileName());
|
296
|
+
|
297
|
+
holder.tv_nbFollowers.setText(mData.get(position).getNbFollowers()+"Followers");
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
}
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
@Override
|
306
|
+
|
307
|
+
public int getItemCount() {
|
308
|
+
|
309
|
+
return 0;
|
310
|
+
|
311
|
+
}
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
public class myViewHolder extends RecyclerView.ViewHolder {
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
ImageView profile_photo,background_img;
|
320
|
+
|
321
|
+
TextView tv_title,tv_nbFollowers;
|
322
|
+
|
323
|
+
|
324
|
+
|
325
|
+
public myViewHolder(View itemView) {
|
326
|
+
|
87
|
-
|
327
|
+
super(itemView);
|
328
|
+
|
88
|
-
|
329
|
+
profile_photo = itemView.findViewById(R.id.profile_img);
|
330
|
+
|
89
|
-
and
|
331
|
+
background_img = itemView.findViewById(R.id.card_background);
|
90
|
-
|
91
|
-
|
332
|
+
|
92
|
-
|
93
|
-
android:layout_height="match_parent"
|
94
|
-
|
95
|
-
app:layout_constraintBottom_toBottomOf="parent"
|
96
|
-
|
97
|
-
|
333
|
+
tv_title = itemView.findViewById(R.id.card_title);
|
98
|
-
|
334
|
+
|
99
|
-
|
335
|
+
tv_nbFollowers = itemView.findViewById(R.id.card_nb_follower);
|
100
|
-
|
336
|
+
|
101
|
-
|
337
|
+
}
|
102
|
-
|
338
|
+
|
103
|
-
|
339
|
+
}
|
340
|
+
|
104
|
-
|
341
|
+
}
|
342
|
+
|
105
|
-
```
|
343
|
+
```
|
106
|
-
|
344
|
+
|
107
|
-
-
|
345
|
+
- MainActivity.java
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
私のソース
|
112
346
|
|
113
347
|
```ここに言語を入力
|
114
348
|
|
349
|
+
public class MainActivity extends AppCompatActivity {
|
350
|
+
|
351
|
+
|
352
|
+
|
353
|
+
@Override
|
354
|
+
|
355
|
+
protected void onCreate(Bundle savedInstanceState) {
|
356
|
+
|
115
|
-
|
357
|
+
super.onCreate(savedInstanceState);
|
358
|
+
|
116
|
-
|
359
|
+
setContentView(R.layout.activity_main);
|
360
|
+
|
361
|
+
|
362
|
+
|
117
|
-
|
363
|
+
Window w = getWindow();
|
364
|
+
|
118
|
-
|
365
|
+
w.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS,WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
|
366
|
+
|
367
|
+
|
368
|
+
|
369
|
+
RecyclerView recyclerView = findViewById(R.id.rv_list);
|
370
|
+
|
371
|
+
List<item> mlist = new ArrayList<>();
|
372
|
+
|
373
|
+
mlist.add(new item(R.drawable.food,"Food",R.drawable.ic_people, 2500));
|
374
|
+
|
375
|
+
mlist.add(new item(R.drawable.food,"Food",R.drawable.ic_people, 2500));
|
376
|
+
|
377
|
+
mlist.add(new item(R.drawable.food,"Food",R.drawable.ic_people, 2500));
|
378
|
+
|
379
|
+
mlist.add(new item(R.drawable.food,"Food",R.drawable.ic_people, 2500));
|
380
|
+
|
381
|
+
mlist.add(new item(R.drawable.food,"Food",R.drawable.ic_people, 2500));
|
382
|
+
|
383
|
+
Adapter adapter = new Adapter(this,mlist);
|
384
|
+
|
385
|
+
recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
386
|
+
|
119
|
-
|
387
|
+
recyclerView.setAdapter(adapter);
|
388
|
+
|
120
|
-
|
389
|
+
}
|
390
|
+
|
391
|
+
}
|
392
|
+
|
121
|
-
```
|
393
|
+
```
|
122
|
-
|
123
|
-
動画のソース
|
124
|
-
|
125
|
-
```ここに言語を入力
|
126
|
-
|
127
|
-
compileSdkVersion 27
|
128
|
-
|
129
|
-
minSdkVersion 15
|
130
|
-
|
131
|
-
targetSdkVersion 27
|
132
|
-
|
133
|
-
```
|