В ListView
текст вместо букв отображается ромбиками со знаками вопросов. В чем причина?
Небольшой апдейт: цифры отображаются нормально... А вот буквы нет. Поэтому захардкоренность отпадает
MainActivity.java
package ru.N.wo;
import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ListAdapter;
import android.widget.SimpleAdapter;
import java.util.ArrayList;
public class MainActivity extends ListActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ArrayList<Contact> list = new ArrayList<Contact>();
// Заполняем данными
list.add(new Contact("1111", "47ап", "ттт", "Яггг, Пее", "еее"));
list.add(new Contact("2222", "67п", "еееку", "мттм", "аиаа"));
list.add(new Contact("3333", "98вп", "ттт", "уим, иеу", "Еаа"));
list.add(new Contact("4444", "13дв", "yyy", "иаы, аиа", "вв"));
list.add(new Contact("5555", "77ьв", "панк", "пвп, куя", "мммм"));
list.add(new Contact("6666", "34pпвп", "куй", "пвп, Пвпв", "пп"));
list.add(new Contact("77", "42pп", "народ", "Алгебра, математика", "ппп"));
list.add(new Contact("879", "13пв", "ФИзика", "лла, право", "френч"));
list.add(new Contact("3535", "24ав", "Химия", "нана", "Ее"));
ListAdapter adapter = new SimpleAdapter(this, list, R.layout.group_view,
new String[] {Contact.TI, Contact.CO, Contact.NA, Contact.S, Contact.HO}, new int[] {
R.id.te, R.id.to, R.id.tr, R.id.st, R.id.ho });
setListAdapter(adapter);
}
}
group_view.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/eor"
android:layout_marginTop="5dp"
>
<ImageView android:layout_width="50dp"
android:layout_height="50dp"
android:background="@drawable/koko"
android:id="@+id/imageView25"
android:layout_alignParentTop="true"
android:layout_marginTop="8dp" android:layout_marginBottom="8dp" android:layout_marginLeft="8dp"/>
<ImageView android:layout_width="50dp"
android:layout_height="50dp"
android:background="@drawable/rruururu"
android:id="@+id/imageView5"
android:layout_alignParentTop="true" android:layout_alignRight="@+id/to"
android:layout_marginTop="8dp" android:layout_marginRight="8dp" android:layout_marginBottom="8dp"/>
<View
android:id="@+id/separator1"
android:layout_width="5px"
android:layout_height="wrap_content"
android:background="@drawable/separator1" android:layout_toRightOf="@+id/lo" android:layout_alignBottom="@+id/stations"
android:layout_toLeftOf="@+id/ho"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/ttt"
android:textSize="16dp"
android:id="@+id/te"
android:layout_below="@+id/tr" android:layout_alignLeft="@+id/imageView200"
android:layout_marginLeft="5dp"/>
<ImageView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/line"
android:id="@+id/lo"
android:layout_alignParentLeft="true"
android:layout_marginLeft="90dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/drawer_item_color"
android:textSize="15dp"
android:id="@+id/tr"
android:layout_alignParentLeft="true" android:layout_marginLeft="90dp"
android:layout_toLeftOf="@+id/imageView5"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/text1"
android:textSize="15dp"
android:id="@+id/ho"
android:layout_toLeftOf="@+id/imageView5" android:layout_alignTop="@+id/te"
android:layout_alignLeft="@+id/tr"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/about"
android:textSize="20dp"
android:id="@+id/st"
android:layout_toLeftOf="@+id/imageView5"
android:layout_below="@+id/ho" android:layout_alignLeft="@+id/ho"
/>
<TextView
android:layout_width="45dp"
android:layout_height="wrap_content"
android:textColor="@color/about"
android:textSize="15dp"
android:id="@+id/to"
android:layout_alignBottom="@+id/imageView5"
android:layout_below="@+id/tr" android:layout_alignParentRight="true"/>
</RelativeLayout>
Contact.class
package ru.N.wo;
import java.util.HashMap;
public class Contact extends HashMap<String, String> {
public static final String TI = "ti";
public static final String CO = "co";
public static final String NA = "na";
public static final String ST = "st";
public static final String HO = "ho";
// Конструктор с параметрами
public Contact(String ti, String co, String na, String st, String ho) {
super();
super.put(TI, ti);
super.put(CO, co);
super.put(NA, na);
super.put(ST, st);
super.put(HO, ho);
}
}