安卓:
public class LocationService extends Service {
@Override
public void onStart(Intent intent, int startId) {
super.onStart(intent, startId);
startActivity(new Intent(this, activity.class));
}
}
Run Code Online (Sandbox Code Playgroud)
我推出了这项服务 Activity
在Activity如果条件满足启动
startService(new Intent(WozzonActivity.this, LocationService.class));
Run Code Online (Sandbox Code Playgroud)
从我LocationService上面提到的无法启动Activity,我怎样才能获得当前Activity在服务类中运行的上下文?