Я создал серию списков в моем приложении, используя базовый формат списка, как показано ниже, я пытаюсь добавить границу и заголовок для каждого из списков, но всякий раз, когда я пытаюсь добавить что-либо в xml, он принудительно закрывается, Я пробовал textview framelayout ничего не работает, кто-нибудь может помочь с этим?
package com.ff.org.p;
import android.app.ListActivity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import com.ff.org.R;
import com.ff.org.prrums.Anforums;
import com.ff.org.preps.Locare;
public class Ar extends ListActivity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
// Create an array of Strings, that will be put to our ListActivity
String[] names = new String[] { "Forums", "Visitor Info", "Travel", "History", "Live Text" };
ListView lv = getListView();
lv.setBackgroundResource(R.drawable.background);
lv.setCacheColorHint(00000000);
this.setListAdapter(new ArrayAdapter<String>(this, R.layout.list_item, names));
}
// Get the item that was clicked
@Override
public void onListItemClick(ListView l, View v, int position, long id) {
if (position == 0) {
Intent intent = new Intent(this, Arsenforums.class);
startActivity(intent);
}
if (position == 1) {
String url = "http://www.ide.com/nal/";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
} else if (position == 2) {
Intent intent = new Intent(this, Locarse.class);
startActivity(intent);
}
}
}
XML
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:padding="10dp"
android:textColor="@color/black"
android:textSize="21sp">
</TextView>
Любая помощь с этим