0

I'm sending a filename (with EXTRA_MESSAGE) to a class extending Android Service. I'm receiving in this way:

 public int onStartCommand(Intent intent, int flags, int startId) { // new start


        mNotificationHelper = new NotificationHelper(getBaseContext());

        if (intent != null)
            meta = intent.getStringArrayExtra(VideoCompress.EXTRA_MESSAGE);

        //extracting filename from the whole path
        fileNamePath= meta[0];

}

All works fine, except for the fact that when I exit the application (with finish), the Service seems to restart and a null pointer exception is called on:

fileNamePath= meta[0];

because the activities are destroyed, obviously.

Any ideas to solve this ?

andreasperelli
  • 1,034
  • 2
  • 11
  • 40

0 Answers0