在我的一个应用程序中,我需要在一段时间后在后台更新用户位置 我创建了
DataSendingReceiver extends BroadcastReceiver
from that i called a class DataSendingService data = new DataSendingService(context);
我的一些代码是:
public class DataSendingReceiver extends BroadcastReceiver {
Context context;
GPSTracker gpsTracker;
MySharedPreferenses mySharedPreferenses;
@Override
public void onReceive(Context context, Intent arg1) {
// TODO Auto-generated method stub
this.context = context;
mySharedPreferenses = new MySharedPreferenses(context);
if (!mySharedPreferenses.isUserLogin()) {
return;
}
Log.d("DataSendingReceiver", "receiver excuted");
DataSendingService data = new DataSendingService(context);
gpsTracker = new GPSTracker(context);
DataSendingService是一个类
public class DataSendingService implements GoogleApiClient.ConnectionCallbacks,
GoogleApiClient.OnConnectionFailedListener, com.google.android.gms.location.LocationListener {
在清单中我添加了
<receiver
android:name=".receiver.DataSendingReceiver"
android:enabled="true"
android:exported="true"
android:label="RestartServiceWhenStopped"
android:process=":remote" />
请帮助我