How To Use Action_package_first_launch Intent-filter To Start Application?
I am trying to use the intent-filter ACTION_PACKAGE_FIRST_LAUNCH to make the application do some tasks when it first launched, however it not being captured by the broadcast receiv
Solution 1:
Sorry those intents except for boot_completed are only sent to the play store. But it is relatively simple to do what you need otherwise. Instead use SharedPreferences, like example:
public static final String KEY_PREFS_FIRST_LAUNCH = "first_launch";
// ...
SharedPreferences prefs = SharedPreferences.getDefaultSharedPreferences(this);
if(prefs.getBoolean(KEY_PREFS_FIRST_LAUNCH, true))
{
//first launch
prefs.edit().putBoolean(KEY_PREFS_FIRST_LAUNCH,false).commit();
}
Post a Comment for "How To Use Action_package_first_launch Intent-filter To Start Application?"