Monday, July 30, 2012

[android-developers] Re: Regarding Application is not installed alert

Don't do the permission check in the child application manifest. Use:

http://developer.android.com/reference/android/app/Activity.html#startActivityForResult%28android.content.Intent,%20int%29

from your launcher, and in the child apps use:

http://developer.android.com/reference/android/app/Activity.html#getCallingActivity%28%29

or

http://developer.android.com/reference/android/app/Activity.html#getCallingPackage%28%29

Do some application/package manager gyrations to get the UID/PID of the calling app and look for your permission with:

http://developer.android.com/reference/android/content/ContextWrapper.html#checkPermission%28java.lang.String,%20int,%20int%29

If there is no permission, or getCallingActivity returns null, put up your "use my launcher" screen (or even better, just
launch your launcher if it was called by somebody else and let them start from there), otherwise, do your stuff. 

     Dan S.


On Thursday, July 26, 2012 12:31:32 AM UTC-4, Bunty syed wrote:
 
Hi All,

Actually I have one launcher with some child apps.

I have given permission in all child apps so that only my launcher can launch them as follows
<permission android:name="android.permission.LAUNCH_KONY_POLICYINJECTED_APPS" android:protectionLevel="signature"/>

Tat is working fine. So with above, if any other application not signed with same keystore of child apps & not having required permission will get Permission denial exception while trying to launch the child apps .

Now my doubt is when I click any of  installed child Apps in the phone application menu, I am getting Alert saying that "Application is not installed.."
 Tat is a expected behavior.
But is there any way to customize that Alert message instead I want to display my alert message like "Plz launch from my launcher app".




--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment