android - How to show alert in any one of running activities of third party app by service -


finds (by starting the service in the activities and shows) I have been running the app for third-party warning How can I alert the activity of third-party apps and it needs to show my alert in an activity.

Please check it out I think we can use it.

  ArrayList & lt; String & gt; Movability = new array list & lt; String & gt; (); Activity Manager ActivityManager = (Activity Manager) getBaseContext (). GetSystemService (Reference Activitivists); & Lt; RunningTaskInfo & gt; Services = activityManager.getRunningTasks (integer MAX_VALUE); (Int i1 = 0; i1 & lt; services.size (); i1 ++) of {runningactivities.add (0, services.get (i1) .topActivity.toString (to)); } If (running activities ( "Gtkinteninfo Comkapp/comkappkmainkMyActivity {}") == true) {toast. GetBaseContext, "Activity is in the foreground, active", 1000). Show (); Alert.show ()}  

How can I get this?


Comments