Ciao.
Non capisco perchè questa classe java non riesce a visualizzare l'immagine (esempio) remota http://www.myhosting.com/images/pic.png
Non ho errori nella console di Eclipse, visualizzo tutte le variabili splittate correttamente ma l'immagine non viene caricata nel file xml associato alla classe java, perchè?
codice:
import android.annotation.SuppressLint;import android.app.Activity;
import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapPrimitive;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;
import com.loopj.android.image.SmartImageView;
import android.os.Bundle;
import android.os.StrictMode;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.widget.TextView;
public class news extends Activity {
private static final String SOAP_ACTION = "http://...";
private static final String OPERATION_NAME = "...";
private static final String WSDL_TARGET_NAMESPACE = "http://...";
private static final String SOAP_ADDRESS = "http://...";
@SuppressLint("NewApi")
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_news);
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder()
.permitAll().build();
StrictMode.setThreadPolicy(policy);
SmartImageView profileImage = (SmartImageView) findViewById(R.id.profileImage);
TextView textView = new TextView(this);
setContentView(textView);
SoapObject request = new SoapObject(WSDL_TARGET_NAMESPACE,
OPERATION_NAME);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.implicitTypes = false;
envelope.setOutputSoapObject(request);
HttpTransportSE httpTransport = new HttpTransportSE(SOAP_ADDRESS);
httpTransport.debug = true;
envelope.setOutputSoapObject(request);
try {
httpTransport.call(SOAP_ACTION, envelope);
SoapPrimitive response = (SoapPrimitive) envelope.getResponse();
String phrase = response.toString();
String delims = "[\n]";
String[] tokens = phrase.split(delims);
for (int i = 0; i < tokens.length; i++)
textView.append(Html.fromHtml(tokens[i] + "\n"));
textView.setMovementMethod(LinkMovementMethod.getInstance());
profileImage.setImageUrl("http://www.myhosting.com/images/pic.png");
} catch (Exception exception) {
textView.setText(exception.toString());
}
}
}