直接サーバーから更新する方法を追加
This commit is contained in:
parent
3650ca9b4d
commit
1c534adca4
|
@ -132,7 +132,7 @@ public class ChildManageMainActivity extends AppCompatActivity {
|
|||
Toast.makeText(this, "名前を入力してください", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
childData.addChild(new ChildModel(childName))
|
||||
.thenRun(this::updateList);
|
||||
.thenRun(this::updateListDirectly);
|
||||
})
|
||||
.setNegativeButton("キャンセル", (dialog, which) -> dialog.dismiss())
|
||||
.show();
|
||||
|
@ -159,4 +159,11 @@ public class ChildManageMainActivity extends AppCompatActivity {
|
|||
runOnUiThread(() -> childListAdapter.notifyDataSetChanged());
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
private void updateListDirectly() {
|
||||
childData.getChildListDirect().thenAccept(childListAdapter::setChildList).thenRun(() -> {
|
||||
runOnUiThread(() -> childListAdapter.notifyDataSetChanged());
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user