傢伙我試圖與網站link
在我textview
位於數據庫 我嘗試添加它直接像這樣的圖像添加大量的文字像(https://stackoverflow.com/questions/ask):如何檢測網站鏈接的TextView並使其可點擊
在DATABSE
我的價值的照片,但它出現在應用程序的形式Textview
不可點擊這樣的形象:
輸出應用
protected void onPostExecute(String result) {
// Parse les données JSON
String id;
String solution;
try {
JSONArray jArray = new JSONArray(result);
for (int i = 0; i < jArray.length(); i++) {
JSONObject json_data = jArray.getJSONObject(i);
id= json_data.getString("alltext");
solution = json_data.getString("title");
prob.setText(solution);
sol.setText(id);
// Résultats de la requête
}
} catch (JSONException e) {
Log.e("log_tag", "Error parsing data " + e.toString());
}
}
非常感謝,請給我另一個問題,我想讓超鏈接例如:(http://www.youtube.com)取代它只是Youtube –
使用此代碼爲超鏈接文本 'TextView textView = (的TextView)findViewById(R.id.textView); textView.setClickable(真); textView.setMovementMethod(LinkMovementMethod.getInstance()); String text =「 Google」; textView.setText(Html.fromHtml(text));' –
工作。謝謝。 –