Unable to find explicit activity class {}; have you declared this activity in your AndroidManifest.xml

后端 未结 2 763
死守一世寂寞
死守一世寂寞 2021-01-18 19:49

I\'m trying unzip some files in background, so I use IntentService like in google\'s tutorial. My service class declared in AndroidManifest like this:



        
相关标签:
2条回答
  • 2021-01-18 20:23

    Please declared this activity in your AndroidManifest.xml

    0 讨论(0)
  • 2021-01-18 20:38

    You are starting a service as an activity

    Change

    Intent mServiceIntent = new Intent(context, UnZipService.class);
    mServiceIntent.setData(Uri.parse(savedFilePath));
    startActivity(mServiceIntent);
    

    to

    Intent mServiceIntent = new Intent(context, UnZipService.class);
    mServiceIntent.setData(Uri.parse(savedFilePath));
    startService(mServiceIntent); // Only this line is changed
    
    0 讨论(0)
提交回复
热议问题