0

I have a service

<service android:name="com.example.myapplication_sync.MainService" />

The service is simply

class MainService: Service() {

    override fun onCreate() {
        super.onCreate()
        Log.d("Tracking", "Service started")
    }

    override fun onBind(intent: Intent?): IBinder? {
        return null
    }
}

I can start the service using

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_main)
    Intent(this, MainService::class.java).also { intent ->
        startService(intent)
    }
}

But if the process is

<service android:name="com.example.myapplication_sync.MainService" 
    android:process=":myDifferentProcess"
/>

I can't seem to start the service anymore. Is this no longer work now, or I miss something?

Note: I have compile and target SDK/API of 30, and I'm running on Android Device API SDK 30 on emulator

Elye
  • 53,639
  • 54
  • 212
  • 474

0 Answers0