我有一個字符串是在HTML中,我想要得到它並將其添加到我的ArraryList。如何獲取HTML字符串
ArrayList<Adapter> strings = new ArrayList<Adapter>();
///------------/////
////////////////////
strings.add(new Adapter("", ""));
字符串:
<string name="stringg"><![CDATA[<b>Title</b><br><small>Description]]></string>
我試圖strings.add(new Adapter(""+R.string.stringg, ""));
但談到了一些。
適配器代碼:
public class Adapter{
public String first;
public String last;
public Code(String first, String last) {
this.first = first;
this.last = last;
}
public static ArrayList<Adapter> getCodes() {
ArrayList<Adapter> strings = new ArrayList<Adapter>();
strings.add(new Adapter("", ""));
return codes;
}
}
你嘗試'getResources()。getString(R.string.stringg)'? – 2014-09-22 18:42:08
@ρяσѕρєяK我得到「該方法getResources()是未定義的類型適配器」 – 2014-09-22 18:43:22
顯示適配器「類代碼 – 2014-09-22 18:45:24