Hello, ๋๋'s world !
ERROR: Can't convert object of type java.lang.String to type ๋ณธ๋ฌธ
๐จ์ฝ์ง์ผ๊ธฐ
ERROR: Can't convert object of type java.lang.String to type
Nana0 2021. 1. 18. 19:24RecyclerView์ ํ์ด์ด๋ฒ ์ด์ค ๋ฐ์ดํฐ๋ฅผ ์ ๋ก๋ ํ๋ ๊ณผ์ ์์ ์๋ฌ๊ฐ ์๊ฒผ๋ค.
๊ฐ๋ง๋ณด๋ ํ์ ์ด ์๋ง์์ ์๊ธด ์๋ฌ๊ฐ๋ค. String ์ผ๋ก ํธ์ถํ๋๊ฒ์ด ์๋ง๋๊ฒ ๊ฐ์์ ์ฐพ์๋ดค๋ค.
์ฝ๋์ ํ์ด์ด๋ฒ ์ด์ค DB ๋ ธ๋์ฐฝ์ ๋ณด์๋ค.
mFamRef = FirebaseDatabase.getInstance().getReference("Family").child(TEST_FAMILY).child("LetterContants").child("2021-01-18-03-59-35");
mFamRef.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot snapshot) {
if(snapshot.exists()){
for(DataSnapshot npsnapshot : snapshot.getChildren()){
LetterList al = npsnapshot.getValue(LetterList.class);
itemList.add(al);
}
letterListAdapter = new LetterListAdapter(itemList);
recyclerView.setAdapter(letterListAdapter);
}
}
.child("2021-01-18-03-59-35") ๋ฅผ ์ง์์ฃผ๋ ์ ์ฝ์ด์์ง๋ค.
//์์ ๋ ์ฝ๋
mFamRef = FirebaseDatabase.getInstance().getReference("Family").child(TEST_FAMILY).child("LetterContants");
mFamRef.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot snapshot) {
if(snapshot.exists()){
for(DataSnapshot npsnapshot : snapshot.getChildren()){
LetterList al = npsnapshot.getValue(LetterList.class);
itemList.add(al);
}
letterListAdapter = new LetterListAdapter(itemList);
recyclerView.setAdapter(letterListAdapter);
}
}
'๐จ์ฝ์ง์ผ๊ธฐ' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Git ) This branch has conflicts that must be resolved (0) | 2021.01.26 |
---|---|
Attempt to invoke virtual method 'void androidx.constraintlayout.widget.Constrai (0) | 2021.01.18 |
Comments