在我的应用程序中使用服务,我从活动 A 启动服务,我在活动 A 中有列表视图,如何刷新服务中的列表视图?
活动一
// in this class I have list view
Intent service = new Intent(Activity_A.this, Time_out_services.class);
startService(service);
服务类
public class Time_out_services extends Service{
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
// TODO do something useful
mHandler.postDelayed(first_Task, 2*60 * 1000);
return Service.START_NOT_STICKY;
}
Runnable first_Task = new Runnable() {
public void run() {
// I want to refresh the list view here
}
};
@Override
public IBinder onBind(Intent intent) {
// TODO Auto-generated method stub
return null;
}
}