android start activity from service

后端 未结 7 1051
傲寒
傲寒 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:26

    one cannot use the Context of the Service; was able to get the (package) Context alike:

    Intent intent = new Intent(getApplicationContext(), SomeActivity.class);
    

提交回复
热议问题