Android – Place Market link inside the App

By -
Problem: How to place a Market link inside the Android application?

Description:
While answering on StackOverflow, I came across one question on placing market link inside the application and I thought it’s very useful and I thought to document it. You might came across the same problem.

There are many ways to put link but what about to place the link with market application URL? So here is the solution.

Solution:
TextView txtView = (TextView) findViewById(R.id.textView1);

Pattern appWordMatcher = Pattern.compile("b[A-Z]+[a-z0-9]+[A-Z][A-Za-z0-9]+b");
String appMarketURL = "market://details?id=com.digicorp.twitrivals&hl=pt_PT";
Linkify.addLinks(txtView, appWordMatcher, appMarketURL);

For more info: http://developer.android.com/resources/articles/wikinotes-linkify.html

CEO & Co-Founder at SolGuruz® | Organiser @ GDG Ahmedabad | Top 0.1% over StackOverflow | 15+ years experienced Tech Consultant | Helping startups with Custom Software Development

Loading Facebook Comments ...
Loading Disqus Comments ...