I'm attempting to bundle extras between a service and another class I've built but I'm having trouble due to a force close error stating "java.lang.NullPointerException at com.test.generic.clientprovisioninghandler.DataCountService.onStartCommand(DataCountService.java:46)"
Which is the line Bundle extras = getIntent().getExtras();
Any suggestions as to how to correct this are greatly appreciated!
SOURCE:
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");
if (intent == null) {
// Exit gracefully is service not started by intent
Log.d(Constants.TAG, "Error: Null Intent");
} else {
Bundle extras = getIntent().getExtras();
if (extras != null) {
text = extras.getString(Constants.DM_SMS_CONTENT);
// check for Enable or Disable Value - if set to enable
// check for Enable or Disable Value - if set to enable
if (extras.getString(Constants.DM_SMS_CONTENT).contains(
"//USR;1")) {