Я получаю сообщение от PHP-скрипта. И я загружаю это в textview в приложении для Android. Это сейчас показывается как текст. Как я могу отобразить его как гиперссылку, чтобы щелкнуть по нему, чтобы перейти к электронной почте?
package com.example.login2;
import java.util.ArrayList;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;
import android.widget.TextView;
public class SAppointmentActivity extends Activity {
TextView news;
@Override
protected void onCreate(Bundle savedInstanceState1) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState1);
setContentView(R.layout.snews);
news = (TextView)findViewById(R.id.news);
news.setText("Hello");
ArrayList<NameValuePair> postParameters = new ArrayList<NameValuePair>();
MyApp MyAppVar = new MyApp();
postParameters.add(new BasicNameValuePair("username", MyAppVar.getName()));
postParameters.add(new BasicNameValuePair("password", MyAppVar.getPasswd()));
//String valid = "1";
String response = null;
try {
response = CustomHttpClient.executeHttpPost("http://192.168.1.8/appointment.php", postParameters);
String res=response.toString();
// res = res.trim();
//res= res.replaceAll("\\s+","");
news.setText(res);
}
catch (Exception e) {
news.setText("Error");
}
}
}