我想在我第一次使用我的程序时得到事件所以我决定使用这个服务
public class PackageChangeReceiver extends BroadcastReceiver {
Context context;
@Override
public void onReceive(Context ctx, Intent intent) {
}}
并在主要的
<receiver android:name=".PackageChangeReceiver" >
<intent-filter>
<action android:name="android.intent.action.PACKAGE_REMOVED" />
<action android:name="android.intent.action.PACKAGE_REPLACED" />
<action android:name="android.intent.action.PACKAGE_ADDED" />
<data android:scheme="package" />
</intent-filter>
</receiver>
但是这个服务在我第一次安装我的应用程序时不起作用,我怎样才能让它在第一次运行?或者不可能这样做?我必须第二次从 eclipse 更新应用程序才能使该服务正常工作,这是什么问题。
android 系统什么时候可以使用它的服务,我曾经想过我应该运行我的一项活动来使服务可用,是真的吗?