0

hi I added link on toolbar and gave permission in the manifest but it didnt work. What is mistake? thanks alot: in the mainactivity:

Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    //getSupportActionBar().setTitle(R.string.asd);
    getSupportActionBar().setTitle(Html.fromHtml(getString(R.string.asd)));

manifest:

 <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

String file:

 <string name="asd"><![CDATA[<h3 style="text-align: center;"><a href="http://www.google.com">go this page</a></h3>]]></string>
Gowthaman M
  • 8,057
  • 8
  • 35
  • 54
a.dem
  • 11
  • 1
  • 7
  • Maybe because this is not the way to do that. Have a look [here](https://developer.android.com/training/appbar/actions.html) and [there](https://stackoverflow.com/questions/31231609/creating-a-button-in-android-toolbar) – Eselfar Jan 30 '18 at 14:31
  • Instead of adding it as a hyperlink provide click on the text and listen to that click. – Aj 27 Jan 30 '18 at 14:32
  • @a.dem you are using fragment or activity – Gowthaman M Jan 30 '18 at 14:32

0 Answers0