fix urls with spaces crash in combined mode

This commit is contained in:
Andrew Dolgov 2012-02-16 20:03:18 +03:00
parent a121c55e96
commit f9af447124
2 changed files with 2 additions and 2 deletions

View File

@ -378,7 +378,7 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
if (tt != null) { if (tt != null) {
if (m_combinedMode) { if (m_combinedMode) {
tt.setMovementMethod(LinkMovementMethod.getInstance()); tt.setMovementMethod(LinkMovementMethod.getInstance());
tt.setText(Html.fromHtml("<a href=\""+article.link.replace("\"", "\\\"")+"\">" + article.title + "</a>")); tt.setText(Html.fromHtml("<a href=\""+article.link.trim().replace("\"", "\\\"")+"\">" + article.title + "</a>"));
} else { } else {
tt.setText(Html.fromHtml(article.title)); tt.setText(Html.fromHtml(article.title));
} }

View File

@ -285,7 +285,7 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis
if (tt != null) { if (tt != null) {
if (m_combinedMode) { if (m_combinedMode) {
tt.setMovementMethod(LinkMovementMethod.getInstance()); tt.setMovementMethod(LinkMovementMethod.getInstance());
tt.setText(Html.fromHtml("<a href=\""+article.getString(article.getColumnIndex("link")).replace("\"", "\\\"")+"\">" + tt.setText(Html.fromHtml("<a href=\""+article.getString(article.getColumnIndex("link")).trim().replace("\"", "\\\"")+"\">" +
article.getString(article.getColumnIndex("title")) + "</a>")); article.getString(article.getColumnIndex("title")) + "</a>"));
} else { } else {
tt.setText(Html.fromHtml(article.getString(article.getColumnIndex("title")))); tt.setText(Html.fromHtml(article.getString(article.getColumnIndex("title"))));