У меня есть следующий код, который используется для создания пользовательского ListView
в моем приложении с двумя вкладками:GetResources() бросает ошибку
package com.test.testing;
import android.content.Context;
import android.text.Html;
public class SetRows {
int image;
String name;
String id;
public int getImage() {
return image;
}
public void setImage (int image) {
this.image = image;
}
public String getName() {
return name;
}
public void setName (String name) {
this.name = name;
}
public String getID() {
return id;
}
public void setID (String id) {
this.id = id;
}
public SetRows(int image, String name, String id) {
super();
this.image = image;
this.name = Html.fromHtml(getResources().getString(R.string.colorcol)) + " COLOR: \n\t" + name;
this.id = "MEANS: \n\t" + id;
}
}
Следующая строка:
this.name = Html.fromHtml(getResources().getString(R.string.colorcol)) + " COLOR: \n\t" + name;
дает мне следующую ошибку:
The method getResources() is undefined for the type SetRows
Что вы должны изменить к содержанию. add (новые SetRows (это, inIconShow, sColor, sExplain)); – DigCamara
СПАСИБО! :) играл вокруг и исправил его ... – Si8