Tuesday, December 11, 2012

How to make an Activity fullscreen??

There are two ways to make an activity fullscreen,

In your OnCreate method in the activity class,


getWindow().addFlags(LayoutParams.FLAG_FULLSCREEN);

From AndroidManifest.xml:

<activity android:name=" "

---

----

android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />




Tuesday, December 4, 2012

Clickable links for textview inside Listview - Android

How to make a URL/link clickable in a textview which is inside a Listview?


Let us assume that you are binding your Listview to a custom adapter. In that case, the following piece of code goes into your getView method call:
Code:
textView.setText(Html.fromHtml(item.gettext()));
textView.setAutoLinkMask(Linkify.WEB_URLS);
Took me sometime to find this out :)