我收到错误上下文需要 FLAG_ACTIVITY_NEW_TASK 标志,尽管我已经设置了它。有什么建议么?
public class DataCountService extends Service {
String text = "USR;1";
String ERROR = Constants.PREFS_NAME;
private Timer timer = new Timer();
private long period;
private long delay_interval;
private Intent getIntent() {
// TODO Auto-generated method stub
return null;
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
Log.d(Constants.TAG, "Logging Service Started");
super.onStartCommand(intent, flags, startId);
Intent i = new Intent(this, DataCountUtilities.class);
startActivity(i);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Bundle extras = intent.getExtras();
if (intent == null) {
// Exit gracefully is service not started by intent
Log.d(Constants.TAG, "Error: Null Intent");