Soru & Cevap

Firebase resim geç gelme sorunu

16.10.2020 - 01:07

Firma objesinin içindeki logo kısmına atama yapmaya çalışıyorum ama resimlerin geç gelemsinden kaynaklı olarak null olarak listeye kayıt oluyor.

Acaba bir resim tam olarak listeye kayıt olduğunu yada veritabanından resmin çekildiğini nasıl anlayabilir.

İlk firma bilgileri tam olarak dolduktan sonra 2. firmaya ait bilgileri nasıl çekebilirim.

 

reference.addValueEventListener(new ValueEventListener() {
            @Override
            public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
                firmalist.clear();
                for (DataSnapshot d : dataSnapshot.getChildren()) {
                    final Firma firma = d.getValue(Firma.class);
                    firma.setFirma_id(d.getKey());
                    firmalist.add(firma);
                    try {
                        localFile = File.createTempFile("images", "jpg");
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                    referans.child(firma.getFirma_id()).child("1").getFile(localFile).addOnSuccessListener(new OnSuccessListener<FileDownloadTask.TaskSnapshot>() {
                        @Override
                        public void onSuccess(FileDownloadTask.TaskSnapshot taskSnapshot) {
                            Bitmap bitmap = BitmapFactory.decodeFile(localFile.getAbsolutePath());
                            firma.setLogo(bitmap);
                        }

                    });
                }


            //    veriadaptoru.notifyDataSetChanged();
                Log.e("hata",""+firmalist.get(2).getLogo());
            }

            @Override
            public void onCancelled(@NonNull DatabaseError databaseError) {

            }
        });

 

 

 

 

8 Görüntülenme

9 Cevap

Sitedeki sorulara cevap verebilmek için giriş yapın ya da üye olun.

picture-307552-1601310528.png
jfirat.alabuga
17.10.2020 - 05:43

StreamSubscription<QuerySnapshot> subscription;
List<DocumentSnapshot> wallpapersList;
final CollectionReference collectionReference =
Firestore.instance.collection("wallpapers");

@override
void initState() {
// TODO: implement initState
super.initState();
FirebaseAdMob.instance
.initialize(appId: "ca-app-pub-4252364201498947~9120074333");
_bannerAd = createBannerAd()
..load()
..show();
subscription = collectionReference.snapshots().listen((datasnapshot) {
setState(() {
wallpapersList = datasnapshot.documents;
});
});
// _currentScreen();
}

picture-307552-1601310528.png
jfirat.alabuga
17.10.2020 - 05:43

StreamSubscription<QuerySnapshot> subscription;
List<DocumentSnapshot> wallpapersList;
final CollectionReference collectionReference =
Firestore.instance.collection("wallpapers");

@override
void initState() {
// TODO: implement initState
super.initState();
FirebaseAdMob.instance
.initialize(appId: "ca-app-pub-4252364201498947~9120074333");
_bannerAd = createBannerAd()
..load()
..show();
subscription = collectionReference.snapshots().listen((datasnapshot) {
setState(() {
wallpapersList = datasnapshot.documents;
});
});
// _currentScreen();
}

picture-307552-1601310528.png
jfirat.alabuga
17.10.2020 - 05:42

StreamSubscription<QuerySnapshot> subscription;
List<DocumentSnapshot> wallpapersList;
final CollectionReference collectionReference =
Firestore.instance.collection("wallpapers");

@override
void initState() {
// TODO: implement initState
super.initState();
FirebaseAdMob.instance
.initialize(appId: "ca-app-pub-4252364201498947~9120074333");
_bannerAd = createBannerAd()
..load()
..show();
subscription = collectionReference.snapshots().listen((datasnapshot) {
setState(() {
wallpapersList = datasnapshot.documents;
});
});
// _currentScreen();
}

picture-307552-1601310528.png
jfirat.alabuga
17.10.2020 - 05:42

StreamSubscription<QuerySnapshot> subscription;
List<DocumentSnapshot> wallpapersList;
final CollectionReference collectionReference =
Firestore.instance.collection("wallpapers");

@override
void initState() {
// TODO: implement initState
super.initState();
FirebaseAdMob.instance
.initialize(appId: "ca-app-pub-4252364201498947~9120074333");
_bannerAd = createBannerAd()
..load()
..show();
subscription = collectionReference.snapshots().listen((datasnapshot) {
setState(() {
wallpapersList = datasnapshot.documents;
});
});
// _currentScreen();
}

picture-307552-1601310528.png
jfirat.alabuga
17.10.2020 - 05:42

StreamSubscription<QuerySnapshot> subscription;
List<DocumentSnapshot> wallpapersList;
final CollectionReference collectionReference =
Firestore.instance.collection("wallpapers");

@override
void initState() {
// TODO: implement initState
super.initState();
FirebaseAdMob.instance
.initialize(appId: "ca-app-pub-4252364201498947~9120074333");
_bannerAd = createBannerAd()
..load()
..show();
subscription = collectionReference.snapshots().listen((datasnapshot) {
setState(() {
wallpapersList = datasnapshot.documents;
});
});
// _currentScreen();
}

picture-307552-1601310528.png
jfirat.alabuga
17.10.2020 - 05:42

StreamSubscription<QuerySnapshot> subscription;
List<DocumentSnapshot> wallpapersList;
final CollectionReference collectionReference =
Firestore.instance.collection("wallpapers");

@override
void initState() {
// TODO: implement initState
super.initState();
FirebaseAdMob.instance
.initialize(appId: "ca-app-pub-4252364201498947~9120074333");
_bannerAd = createBannerAd()
..load()
..show();
subscription = collectionReference.snapshots().listen((datasnapshot) {
setState(() {
wallpapersList = datasnapshot.documents;
});
});
// _currentScreen();
}

picture-307552-1601310528.png
jfirat.alabuga
17.10.2020 - 05:42

StreamSubscription<QuerySnapshot> subscription;
List<DocumentSnapshot> wallpapersList;
final CollectionReference collectionReference =
Firestore.instance.collection("wallpapers");

@override
void initState() {
// TODO: implement initState
super.initState();
FirebaseAdMob.instance
.initialize(appId: "ca-app-pub-4252364201498947~9120074333");
_bannerAd = createBannerAd()
..load()
..show();
subscription = collectionReference.snapshots().listen((datasnapshot) {
setState(() {
wallpapersList = datasnapshot.documents;
});
});
// _currentScreen();
}

picture-307552-1601310528.png
jfirat.alabuga
17.10.2020 - 05:42

StreamSubscription<QuerySnapshot> subscription;
List<DocumentSnapshot> wallpapersList;
final CollectionReference collectionReference =
Firestore.instance.collection("wallpapers");

@override
void initState() {
// TODO: implement initState
super.initState();
FirebaseAdMob.instance
.initialize(appId: "ca-app-pub-4252364201498947~9120074333");
_bannerAd = createBannerAd()
..load()
..show();
subscription = collectionReference.snapshots().listen((datasnapshot) {
setState(() {
wallpapersList = datasnapshot.documents;
});
});
// _currentScreen();
}

picture-307552-1601310528.png
jfirat.alabuga
17.10.2020 - 05:41

StreamSubscription<QuerySnapshot> subscription;
List<DocumentSnapshot> wallpapersList;
final CollectionReference collectionReference =
Firestore.instance.collection("wallpapers");

@override
void initState() {
// TODO: implement initState
super.initState();
FirebaseAdMob.instance
.initialize(appId: "ca-app-pub-4252364201498947~9120074333");
_bannerAd = createBannerAd()
..load()
..show();
subscription = collectionReference.snapshots().listen((datasnapshot) {
setState(() {
wallpapersList = datasnapshot.documents;
});
});
// _currentScreen();
}