0

I am running cordova application on android platform. It shows me these two errors in chome inspect element.

1)Uncaught SyntaxError: Unexpected token =

2)Uncaught Error: [$injector:modulerr]

This is the code for mainActivity :

import android.os.Bundle;
import org.apache.cordova.*;

public class MainActivity extends CordovaActivity
{
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
      Bundle extras = getIntent().getExtras();
        if (extras != null && extras.getBoolean("cdvStartInBackground", false)) {
            moveTaskToBack(true);
        }
        loadUrl("someUrl");
        LOG.e("launchUrl is",launchUrl);
    }
}

Please help me with this. I am unable to find the reason behind this

chancyWu
  • 14,073
  • 11
  • 62
  • 81
honey
  • 23
  • 1
  • 7

1 Answers1

0

You can't check if the extras are null or not in this way. The error comes from the '=' after the '!'. Please have a closer look at this question: Check if extras are set or not

Yvonne Marggraf
  • 398
  • 2
  • 5
  • 19