android start activity from service

后端 未结 7 1052
傲寒
傲寒 2020-11-22 03:04

Android:

public class LocationService extends Service {

@Override
    public void onStart(Intent intent, int startId) {
        super.onStart(intent, startI         


        
7条回答
  •  北海茫月
    2020-11-22 03:52

    UPDATE ANDROID 10 AND HIGHER

    Start an activity from service (foreground or background) is no longer allowed.

    There are still some restrictions that can be seen in the documentation

    https://developer.android.com/guide/components/activities/background-starts

提交回复
热议问题