mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-23 00:13:16 +00:00
改善したもののやっぱり実行するとアプリが落ちる
This commit is contained in:
parent
aaf4264f44
commit
3bf14799b5
|
@ -65,8 +65,8 @@ public class LibraryTopFragment extends Fragment {
|
||||||
Bundle savedInstanceState) {
|
Bundle savedInstanceState) {
|
||||||
// Inflate the layout for this fragment
|
// Inflate the layout for this fragment
|
||||||
View view = inflater.inflate(R.layout.fragment_library_top, container, false);
|
View view = inflater.inflate(R.layout.fragment_library_top, container, false);
|
||||||
|
|
||||||
// Use view.findViewById instead of findViewById
|
// Use view.findViewById instead of findViewById
|
||||||
ListView documentListView = view.findViewById(R.id.document_list);
|
ListView documentListView = view.findViewById(R.id.document_list);
|
||||||
List<String> documentList = new ArrayList<>();
|
List<String> documentList = new ArrayList<>();
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ public class LibraryTopFragment extends Fragment {
|
||||||
|
|
||||||
// レイアウトリソースを指定する(例: simple_list_item_1)
|
// レイアウトリソースを指定する(例: simple_list_item_1)
|
||||||
ArrayAdapter<String> adapter = new ArrayAdapter<>(
|
ArrayAdapter<String> adapter = new ArrayAdapter<>(
|
||||||
requireActivity(), // 使用するActivityに依存する場合は requireActivity() を使う
|
getActivity(), // 修正: requireActivity() ではなく getActivity() を使用
|
||||||
android.R.layout.simple_list_item_1,
|
android.R.layout.simple_list_item_1,
|
||||||
documentList);
|
documentList);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user