Okay, so you created a social share menu item and inflated it in your ActionBar making it look like this.


Then, when you click on it, nothing happens. How so?

You need to attach a share Intent in the ShareActionProvider object. Add this sample short piece of code after your menu gets inflated.

That should make it clickable.

In Swing, an image button is possible by setting the background color of the JButton to transparent and the image will still show its pressed and normal state effect when clicked.

In Java FX 2 however, when you add an image to the Button control and set the background to transparent using -fx-background-color: transparent, you are left with a static image that does not move whenever you click on it.

There is no ready made class in Java FX 2 that does this so the only solution left is to make one. What I did is extend from Button class and simulate the pressed and released effect by changing the padding values whenever a mouse event occurs.

That’s it! It is as simple as that.

There will be cases where we may want our text in strings.xml intact without adding HTML tags in order for hyperlinks to be shown as underlined and colored blue. Just like my experience.

I did not want the text in my strings.xml file for this certain variable to have HTML formatted tags within it.

Let us have an example:

To make the hyperlink in the TextView to be linkable, simply call this programmatically:

That is all. Do not add the attribute android:autoLink=”web” in your layout XML, or else it won’t work.

Related Posts Plugin for WordPress, Blogger...