Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
am trying to open an image link from my Android app using Action View but the link is searched in the System browser like Mi browser but it opens correctly in the browser like Chrome and Microsoft Edge.

Here is my code:

String name = "some text";
                String school = "good text;
                String pdf = "https://www.unicas-official.com/htr?name=" + name +"&school=" + school +"&booler=1";
                Intent itnent = new Intent (Intent.ACTION_VIEW);
                itnent.setData (Uri.parse (pdf));
                startActivity (itnent);

Can someone please help me. This is a very frustrating error. Can you someone please help me

What I have tried:

I have tried everything I could, I got that the URL is being searched instead of being viewed in the web content
Posted
Updated 9-Feb-21 21:41pm
Comments
David Crow 15-Jun-20 9:27am    
"... but the link is searched in the System browser like Mi browser..."

What exactly does this mean?

"... but it opens correctly in the browser like Chrome and Microsoft Edge."

If a page opens correctly in one browser but not another, your code is not the issue.

1 solution

Java
Button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i = new Intent(Intent.ACTION_VIEW);
                i.setData(Uri.parse("Insert your url"));
                startActivity(i);
        });


try this
 
Share this answer
 
Comments
David Crow 11-Feb-21 20:49pm    
How is this any different than what the OP showed he has already tried?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900