getDownloadUrl() doesn't work, "HTTP unknown error"


AL

I have a problem with my code, I try to download an image from Firebase Storage. I am trying to put an image in an ImageView.

 @Override
    public void onBindViewHolder(@NonNull final PostViewHolder postViewHolder, int i) {
        Resources resources = Home_Activity.getResources();
        StorageReference storageReference = FirebaseStorage.getInstance().getReference();
        storageReference.child("images/-LgXJiSUo44zOIzky-eZ.jpeg");
        storageReference.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {
            @Override
            public void onSuccess(Uri uri) {
                postViewHolder.picture.setImageURI(uri);
            }
        }).addOnFailureListener(new OnFailureListener() {
            @Override
            public void onFailure(@NonNull Exception e) {

                Toast.makeText(Home_Activity, e.getLocalizedMessage(), Toast.LENGTH_SHORT).show();
            }
        });


        postViewHolder.name.setText(posts.get(i).getPlace_name());
        postViewHolder.description.setText(posts.get(i).getPlace_detail());
    }

Linux Masters

This is how you load the image, I'm not sure if you can set the uri to the image uri as it can't decode it, but I would use an image loading library like Glide, Fresco, Picasso, etc. to load the uri.

   FirebaseStorage.getInstance().getReference("images/-LgXJiSUo44zOIzky-eZ.jpeg").getDownloadUrl().addOnCompleteListener(new OnCompleteListener<Uri>() {
                        @Override
                        public void onComplete(@NonNull Task<Uri> task) {
                            if(task.isSuccessful()){
                                Uri uri = task.getResult();

                            }
                        }
                    });

Related


getDownloadUrl() doesn't work, "HTTP unknown error"

AL I have a problem with my code, I try to download an image from Firebase Storage. I am trying to put an image in an ImageView. @Override public void onBindViewHolder(@NonNull final PostViewHolder postViewHolder, int i) { Resources resources = Ho

taskSnapshot.getDownloadUrl() method doesn't work

David G private void uploadImageToFirebaseStorage() { StorageReference profileImageRef = FirebaseStorage.getInstance().getReference("profilepics/" + System.currentTimeMillis() + ".jpg"); if (uriProfileImage != null) { progressBar.setVi

taskSnapshot.getDownloadUrl() method doesn't work

David G private void uploadImageToFirebaseStorage() { StorageReference profileImageRef = FirebaseStorage.getInstance().getReference("profilepics/" + System.currentTimeMillis() + ".jpg"); if (uriProfileImage != null) { progressBar.setVi

taskSnapshot.getDownloadUrl() method doesn't work

David G private void uploadImageToFirebaseStorage() { StorageReference profileImageRef = FirebaseStorage.getInstance().getReference("profilepics/" + System.currentTimeMillis() + ".jpg"); if (uriProfileImage != null) { progressBar.setVi

@EnableAspectJAutoProxy doesn't work

Dante's May Code: I am using Spring Boot and I want to use it with AspectJ. The following works (of course): @Aspect @Component public class RequestMappingAspect { @Before("@annotation(org.springframework.web.bind.annotation.RequestMapping)") publ

@EnableAspectJAutoProxy doesn't work

Dante's May Code: I am using Spring Boot and I want to use it with AspectJ. The following works (of course): @Aspect @Component public class RequestMappingAspect { @Before("@annotation(org.springframework.web.bind.annotation.RequestMapping)") publ

clearInterval() doesn't work

Matt Sanchez: possible duplicate: JS - How to clear interval after using setInterval() I have a function that I font-familyuse every 500ms setInterval(I just change it to practice JavaScript ) some text . The function is called by clicking the "Open" button, a

JPEG doesn't work

Anchovies: I have installed java-1.6.0-openjdk-devel. $java -version java version "1.6.0_24" OpenJDK Runtime Environment (IcedTea6 1.11.3) (rhel-1.48.1.11.3.el6_2-x86_64) OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode) When typing jps at the command

Modulus doesn't work

hot: I know this seems like a really stupid question, but I don't understand why this doesn't work. this: System.out.println(5 % .10); It is returning: 0.09999999999999973 I really do not know. I was just learning Java and was good with C# so I tried C#. C#

BorderLayout doesn't work

Thilo: I can't get BorderLayout to work. I want the cancelbutton to be positioned at the bottom, but it doesn't work. code: import java.awt.BorderLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.ButtonModel;

Incrementor doesn't work

jkushner: I have some code that should increment the count. Here is the struct containing the count variable: type PipelineData struct { nodeData map[string]map[string]int lastBurstResults map[string]map[string]string burstReady ma

setJMenuBar doesn't work

kriller509 : After extensive googling, I found that this question is usually case-specific. I've tried many solutions I've found, but none of them worked for me, so I thought it would be appropriate to create a post on this. I am using setJMenuBar and the bar

Gitignore doesn't work

user3280133: My .gitignorefile doesn't work for some reason, and there isn't a ton of google chrome that can fix it. Here is what I have: *.apk *.ap_ *.dex *.class **/bin/ **/gen/ .gradle/ build/ local.properties **/proguard/ *.log It's in the directory maste

WhiteListedAllowFromStrategy doesn't work

CodeWalker: I am using Spring Security 5.1.5.RELEASE and trying to set ALLOW FROMasX-Frame-Options I use WhiteListedAllowFromStrategyand pass a list of urls to the whitelist, although headerwhat is sent isX-Frame-Options: DENY public class WebSecurityConfig ex

Flush() doesn't work

cnaize: Please check this gist and tell me, what's wrong? Why can't I see my messages? gist: https://gist.github.com/cnaize/895f61b762a9f5ee074c If it's simple, I have two functions: func send(param martini.Params, r render.Render) { Ct.Msgs <- param["msg"

RouterLink doesn't work

Jeff: My routing in angular2 app is working fine. But I'll do some routeLink based on this : Here is my route: const routes: RouterConfig = [ { path:'home' , component: FormComponent }, { path:'about', component: AboutComponent }, { path:'**' ,

ScrollToItem doesn't work

Developer 1996 Why is scrollToItem not working in my CollectionView? I am trying to work scrollToItem EnabledID. So, what's the problem and how to fix it? code: var dataArray = NSMutableArray() // dataArray is has a data from Database var EnabledID = Int() En

Or the plumbing doesn't work?

melon For my first Java project, I'm trying to make a simple text based game. Seems or the pipe doesn't work, when I try to enter something after it doesn't work; I have to restart it. public void GameStart() { String playerName = "Player"; String

InterceptorBinding doesn't work

Krishna Chaitanya I created a custom annotation like below @InterceptorBinding @Retention(RUNTIME) @Target(TYPE, METHOD) public @interface Traceable {} I wrote an interceptor as follows @Traceable @Interceptor public class EnterExitLogger { @AroundInvoke

$.focus() doesn't work

Sam Selikoff focus()Last example of jQuery document state $('#id').focus() Should make the input centralized (active). I can't seem to get it to work. I'm trying to use it for the search box even in the console on this site $('input[name="q"]').focus() And I

SwipeRefreshLayout doesn't work

Crocodile I am using SwipeRefreshListenersomething from the support library. I'm setRefreshfrom onPreExecuteand onPostExecuteI'm on the phone AsyncTask. However, nothing changes, no animations. Is there something I'm missing? Are there certain setup parameters

Swiftblock doesn't work

Hennessy I've been trying to figure out how to use JavaScriptCore quickly. However, I have a problem when I have to handle the block as a parameter, as if the block runs immediately and the parameter gets the return value of the block. What am I doing wrong? W

PerformSegueWithIdentifier doesn't work

However I'm trying to use use self.performSegueWithIdentifierto change the view on Storyboard when a JSON file is loaded remotely. For this I am using the Swift class "Agent" to perform HTTP requests. when i write self.performSegueWithIdentifier("toView2", sen