I'm trying to create a shortcut on the home screen that, when pressed, will start a service instead of an activity.
Is it possible? How?
Thanks!
I'm trying to create a shortcut on the home screen that, when pressed, will start a service instead of an activity.
Is it possible? How?
Thanks!
You can create a dummy Activity that simply starts a Service, then finishes itself:
public class MyServiceActivity extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Intent intent = new Intent(this, MyService.class); startService(intent); finish(); } } No, sorry. Shortcuts only launch activities.