Proper way to start and stop DayDream service from activity
问题 I am developing an application which should display a daydream in special circumstances, I searched everywhere to find a proper way to start my daydream service through my MainActivity class with no luck, Currently i am using following code to start daydream and actually it works, but i need a better solution which provides me a way to stop the daydream. public void startDayDream(){ final Intent intent = new Intent(Intent.ACTION_MAIN); try { // Somnabulator is undocumented--may be removed in