I have a widget for my application. This application has two activity: The launcher and the main one.
On click on this widget, it opens the linked app, however for now I'm opening the launcher and then I start my main activity from its launcher activity even if it was already running on the background.
Is it possible, on click, to check if the main activity is already running on the background and if so, resuming it; or opening the launcher otherwise?
There is the code I'm using now to opening the launcher from the widget.
//LISTENER TO OPEN THE APP ON CLICK
Intent clickIntent = new Intent(context, SplashScreen.class);
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, clickIntent, 0);
// Get the layout for the App Widget and attach an on-click listener to the button
views.setOnClickPendingIntent(R.id.widgetstationlayout, pendingIntent);