We deliberately don't send this broadcast to an app when it is first installed (as of cupcake you -will- get the broadcast when being updated from a previous install). It is generally up to the user to launch your app when they want to.
On Tue, Jun 16, 2009 at 12:11 PM, erictcr...@gmail.com <erictcr...@gmail.com > wrote: > > I'm not sure, but I believe the following code may help. > > put the folling in your AndroidManifest.xml as a child of your > Application tag > > <receiver android:name="com.ericcrook.InstallReceiver" > android:enabled="true"> > <intent-filter> > <action > android:name="android.intent.action.PACKAGE_ADDED" / > > > <data android:scheme="package" /> > </intent-filter> > </receiver> > > > Then create a class that extends BroadcastReceiver, and use it's > onReceive method to start your activity > > > public class InstallReceiver extends BroadcastReceiver { > > public void onReceive(Context context, Intent intent) { > > String data = intent.getDataString(); > > if (data.equals("package:com.ericcrook.InstallReceiver")) { > //Start your application using startActivity or whatever is > appropriate for > //your project > } > } > } > > > I'm not very good with the Intent system, so some of this may be > correct, but hopefully this is better than nothing. > > On Jun 16, 6:21 am, Raj <lal.ra...@gmail.com> wrote: > > Hi, > > I want to start my application just after it gets installed on the > > device. Is there any way out in Android to do so. > > I was wondering if there is any receiver to get informed on package > > installed. > > Regards > > > > -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~---------~--~----~------------~-------~--~----~ 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-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---