charlest
charlest

Reputation: 935

How do you use Linkify to issue a startActivity instead of doing a browser link

How do you use Linkify to cause clicking the link to issue a startActivity instead of doing a bowser link? All the examples I've seen use linkify to link to a URL: I want to have clicking the link to cause a transer to an Activity via startActivity.

Upvotes: 0

Views: 585

Answers (1)

Diego Torres Milano
Diego Torres Milano

Reputation: 69388

I guess you already have the link part working, that is your <intent-filter> and scheme to start the Activity.

Then what you need is to use Linkify.addLinks(TextView text, Pattern p, String scheme, Linkify.MatchFilter matchFilter, Linkify.TransformFilter transformFilter) to specify the scheme you selected in the previous step, let's say "com.example.myscheme".

Upvotes: 1

Related Questions