I’m new to android. I’ve developed a library and integrated the same with two apps. And I have broadcast receiver for screen unlock in that library.and have stored unlock count in sharedpreferences. If the count is 2 then i ll show popup.and each application will be having its own private sharedpreferences. Whenever I receive unlock broadcast and the count is 2 then i’ll show a pop up message.here, Since I have integrated the lib with two app,two popup msgs are coming up.I just want to show only one popup from any one of the app.I couldn’t find a solution for this.How it can be achieved. any idea pls?
Thanks
Jeyanthi
You can list the installed applications on the current device using the Package Manager, like this :
Then each PackageInfo contains the package name (com.yourname.package1, com.yourname.package2). You will also have the install and last update time (see the PackageInfo reference).
Then you could on each of those app detect if another one exist and then have some kind of priority. For example, only the last installed app display a popup, or use a priority of your own (application A before application B).