Giter VIP home page Giter VIP logo

Comments (4)

OxygenCobalt avatar OxygenCobalt commented on August 11, 2024 1

Okay, I think I'll just do a version check then. The original motivation behind the existing code was to handle app chooser situations because AFAIK Android didn't handle it that well in older versions, so if Android 11 fixed that issue then I can just do the conventional Uri Intent method on that version and keep the current code for older versions.

from auxio.

OxygenCobalt avatar OxygenCobalt commented on August 11, 2024

Hm. My method for opening the browser might be too invasive then if it requires querying every package. I will need to see if I can do something else.

from auxio.

qwerty287 avatar qwerty287 commented on August 11, 2024

Well, you can use a try and catch, that's how I'm doing it in my apps:

val intent = Intent(Intent.ACTION_VIEW) 
intent.data = Uri.parse("example.com") 
try { 							 								
    startActivity(openURL) 							 								 
} catch (e: ActivityNotFoundException) {
    Toast.makeText(this, "Can't open app", Toast.LENGTH_LONG).show() 							 	
}

The only thing is that you can't open an chooser if no default browser is set (but this is handled by Android itself).

from auxio.

qwerty287 avatar qwerty287 commented on August 11, 2024

so if Android 11 fixed that issue

It just displays this selection dialog:

Screenshot_20210826-175136

from auxio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.