Associate with java code

Is there a way to link the Linkify'd link method in mine, Activityor am I allowed to use Linkifyto create links to other actions / applications, etc.?

+3
source share
4 answers

You can also just opt ​​out of using linkify and just use the regex to snap to go and attach clickable spaces to the places you want. These interactive spaces can trigger your code.

Here is an example: Android: starting activity with interactive text

+2
source

, . , , . , , (android:launchMode="singleTop").

, :

1) addLinks , Linkify.Matcher Linkify.TransformFilter

2) , , .

3) onReceive BroadcastReceiver , , . startActivity Activity ( ), Intent.

4) onResume Activity Intent, , .

+2

You can set up a receiver that will listen to a particular pattern, and when you click on the call call, some kind of URL starts with that pattern.

Check this answer for more details.

0
source

Nope. Linkify comes with:

  • EMAIL_ADDRESSES
  • MAP_ADDRESSES
  • PHONE_NUMBERS
  • WEB_URLS

You can try to expand it. Here is the src code.

-2
source

Source: https://habr.com/ru/post/1754252/


All Articles