i write simple application,in the my activity i call the service with this method:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.newsactivity);
Bundle extras = getIntent().getExtras();
value= extras.getString("myid");
Intent intent = new Intent(this, newsservice.class);
intent.putExtra("behid", value);
startService(intent);
}
and in the my service fetch the image url from server,and i want Load this image on the activity ImageView,my service code is:
public class newimageService extends Service {
String Behid;
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
Behid= intent.getStringExtra("behid");
new HttpAsyncTask().execute("http://sample.org/shownewsimage.aspx");
//in this part show the image into image view
this.stopSelf();
return Service.START_FLAG_REDELIVERY;
}
@Override
public IBinder onBind(Intent intent) {
return null;
}
how can i run the findViewByid(R.imageView)
into this service method?