Browse Tag
links
A collection of useful links for Android developers
I found a convenient way to organize websites that proved to be useful, during the process of developing Android apps.
I organized them in my Trello board (called “Android Developer Links“), combined with the gorgeous Google Chrome extension that is “Trello Card Links“.
I will keep updating this list on an almost daily basis, so feel free to check them out and offer other useful tools yourselves – just post then in the comments below!
Handle links in TextView by Activity
1. Link creation (don’t forget to change the package name):
mTextView= (TextView) findViewById(R.id.init_terms_text); mTextView.setText( Html.fromHtml("By continuing you accept our " + "<a href=\"net.your.packagename://terms\">terms</a> " + " and " + "<a href=\"net.your.packagename://privacy\">privacy policy</a> ")); mTextView.setMovementMethod(LinkMovementMethod.getInstance()); mTextView.setLinksClickable(true);
2. Add target Activity to AndroidManifest.xml (don’t forget to change the package name):
Clickable links in TextView
An example how to set text and clickable links in TextView:
TextView textView = (TextView) findViewById(R.id.init_terms_text); textView.setText( Html.fromHtml("By continuing you accept our " + "<a href=\"http://www.terms.com\">terms</a> " + " and " + "<a href=\"http://www.privacypolicy.com\">privacy policy</a> ")); textView.setMovementMethod(LinkMovementMethod.getInstance());