Make a link in the Android browser start up my app?

前端 未结 9 1134
小鲜肉
小鲜肉 2020-11-21 22:06

Is it possible to make a link such as:

click me!

cause my Anton app to start

9条回答
  •  花落未央
    2020-11-21 22:57

    You may want to consider a library to handle the deep link to your app:

    https://github.com/airbnb/DeepLinkDispatch

    You can add the intent filter on an annotated Activity like people suggested above. It will handle the routing and parsing of parameters for all of your deep links. For example, your MainActivity might have something like this:

    @DeepLink("somePath/{useful_info_for_anton_app}")
    public class MainActivity extends Activity {
       ...
    }
    

    It can also handle query parameters as well.

提交回复
热议问题