Can i add a view to the top activity in broadcast receiver.
ActivityManager am = (ActivityManager) mContext
.getSystemService(Context.ACTIVITY_SERVICE);
List<RunningTaskInfo> taskInfo = am.getRunningTasks(1);
ComponentName componentInfo = taskInfo.get(0).topActivity;
componentInfo.getClassName() returns the class name of the top activity running. I can also get the package name. Can I add a view or some animation on current top activity. I need the layout name in most cases to bind to it but I am not able to figure out how to do it.
Ok . i figured out . I started a service in the background , and then i got hold of the WindowManager and then inflated the view to be added . Then i used windowmanager.addView(inflatedView) .