2
Android库cwac-locpoll
用于查找位置的位置提供程序? 它仅限于GPS,还是可以使用其他来源?cwac-locpoll可以使用多个位置提供程序吗?
Android库cwac-locpoll
用于查找位置的位置提供程序? 它仅限于GPS,还是可以使用其他来源?cwac-locpoll可以使用多个位置提供程序吗?
[该
Intent
为LocationPoller
]应该有另一种多余的,由LocationPoller.EXTRA_PROVIDER
键,与您要使用的位置提供者的名称。
的文档中的示例代码示出了这一点:
mgr=(AlarmManager)getSystemService(ALARM_SERVICE);
Intent i=new Intent(this, LocationPoller.class);
i.putExtra(LocationPoller.EXTRA_INTENT,
new Intent(this, LocationReceiver.class));
i.putExtra(LocationPoller.EXTRA_PROVIDER,
LocationManager.NETWORK_PROVIDER);
pi=PendingIntent.getBroadcast(this, 0, i, 0);
mgr.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP,
SystemClock.elapsedRealtime(),
PERIOD,
pi);