I'm trying to open a link in the browser from service. The problem is that if screen is off then link does not open. Sometimes the browser opens but without any data.
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse("http://somelink.com"));
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(i);
If the screen is on then this code works very well. Why does not it work then screen is off?