Hi
I have an Activity which extends an interface to get notified when some
task is finished.
I want to send the current activity class instance via intent, so that I
can get notified when task is finished.
But how to send the current activity instance?
public class LoginActivity extends Activity implements
DownloadFinishListener, Serializable{
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
doTheDownload("bangla");
}
public void doTheDownload(String title) {
// here I am starting a service to download
Intent i=new Intent(this,
com.riskycoder.downloader.Downloader.class);
title = (title.trim()).replaceAll(" ", "_");
i.setData(Uri.parse("http://10.0.2.2/MusicServer/song/
"+title+".mp3"));
i.putExtra(Downloader.EXTRA_MESSENGER, LoginActivity.this);
startService(i);
}
@Override
public void on_download_finish() {
// oberridden method from interface
}
@Override
public void on_download_not_finish() {
// oberridden method from interface
}
}
The red line stopping the application.
How to send this class object ?
And from service how to get this object to call the overridden method in my
activity when task is finished in service?
Thanks in advance.
Take care.
Regards
Goutom Roy
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en