私はAndroidプログラミングに慣れていないので、リストビューへのリンクを取得することができません。
リンクする私のコードは次のとおりです。
TextView textviewlink = new TextView(this);
textviewlink.setText("text I want to see");
TransformFilter mentionFilter = new TransformFilter() {
public final String transformUrl(final Matcher match, String url) {
return new String("http://test.com/");
}
};
Pattern pattern = Pattern.compile(".");
String scheme = "";
Linkify.addLinks(textviewlink, pattern, scheme, null, mentionFilter);
Now I want to place textviewlink into a HashMap:
ArrayList<HashMap<String, String>> mylist = new ArrayList<HashMap<String, String>>();
HashMap<String, String> map = new HashMap<String, String>();
だから私はこのように追加します:
map.put("c1", "STATUTE");
map.put("c0", " ");
map.put("c2", textviewlink.toString());
mylist.add(map);
その後:
ListView listnew = (ListView) findViewById(R.id.lvdata);
SimpleAdapter mSchedulenew = new SimpleAdapter(this, (List<? extends Map<String, ?>>) mylist, R.layout.row,
new String[] {"c1","c0","c2"}, new int[] {R.id.CELL1,R.id.CELLBlank, R.id.CELL2});
listnew.setAdapter(mSchedulenew);
しかし、それを表示すると、リンクは次のようになります。
android.widget.textview@43e604c0