I am having some textViews in my activity. I am connecting to a server and fetching some data from database and getting a JSON response and loading the data into my activity and setting the textview text with data fetched from server. Everything works fine. Now the problem is that I want to add some default text in the textview. Right now I only have the author name in the textview and it appears as normal but I want that it should appear like Author: Dennis I have tried to use android:text= “Author: ” for author textview but it doesnt work. let me know how can I do this.
<TextView
android:id="@+id/author"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="2dip"
android:paddingLeft="3dip"
android:text="@string/author"
android:textSize="10sp" />
and here is my code where I set the text.
ListAdapter adapter = new SimpleAdapter(
MainActivity.this, productsList,
R.layout.list_item, new String[] {TITLE, AUTHOR},
new int[] { R.id.title, R.id.author });
// updating listview
setListAdapter(adapter);
/Dennis
when you set the text do: