Android的:
public class LocationService extends Service {
@Override
public void onStart(Intent intent, int startId) {
super.onStart(intent, startId);
startActivity(new Intent(this, activity.class));
}
}
我公司推出的活动
在活动
如果条件满足启动
startService(new Intent(WozzonActivity.this, LocationService.class));
这是我的 LocationService
上述无法启动活动
,我怎么能得到当前的环境中运行活动
服务类?
from my LocationService
mentioned above could not launch Activity
, how can I get context of current running Activity
in service class?
在服务类中
Intent dialogIntent = new Intent(this, myActivity.class);
dialogIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(dialogIntent);