My Suggestion is give layout height to webview so that it wont exceed the your specified height
<LinearLayout
android:id="@+id/webview1"
android:layout_width="fill_parent"
android:layout_height="150dip" >
<WebView
android:id="@+id/sampletxt"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</LinearLayout>
In your activity just include the below lines
SampleTxt.getSettings().setLoadWithOverviewMode(true);
SampleTxt.getSettings().setJavaScriptEnabled(true);
SampleTxt.loadData("Your Text To show the Webview",
"text/html; charset=UTF-8", null);
It will work fine. any doubts let me know