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 <[email protected]> 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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---