i can write simple array adapter from class structure, but now i want to write simple array adapter from String, in my application i have simple array as :
private String[] panelNumbers;
panelNumbers = G.getActiveUserInfo().phoneNumbers.split(",");
for show this array into Listview, array items merged with RadioButton, my xml layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ffffff"
android:orientation="vertical" >
<RadioButton
android:id="@+id/radio1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:checkMark="@android:drawable/btn_radio"
android:gravity="right|center_vertical"
android:text="xcgdf"
android:textColor="@color/black_text" />
<TextView
android:id="@+id/text1"
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="@drawable/gradient_divider"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
now i want to fill this array items by custom array adapter my ArrayAdapter dont correct
My ArrayAdapter
public class AdapterSmsPanelNumbers extends ArrayAdapter<String[]> {
public AdapterSlideMenuSMS(String[] array) {
super(G.context, R.layout.call_list, array);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if (convertView == null) {
convertView = G.inflater.inflate(R.layout.single_choice, parent, false);
holder = new ViewHolder(convertView);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
holder.text.setText(array[position]);
return convertView;
}
private static class ViewHolder {
private final TextView text;
private final RadioButton radio;
public ViewHolder(View view) {
text = (TextView) view.findViewById(R.id.text1);
radio = (RadioButton) view.findViewById(R.id.radio1);
}
}
}
PROBLEM i can not fill listview items by single String[], i dont want to create class from panelNumbers,please help me to resolve this class problems to have simple ArrayAdapter showing simple Array
ArrayAdapter<String>andholder.text.setText(getItem(position));