I have app up and running. Push notifications are working ok. I need that when push arrives, bring app to foreground, on Android. So, what I found is this piece of code:
Intent toLaunch = new Intent(getApplicationContext(), MainActivity.class);
toLaunch.setAction("android.intent.action.MAIN");
toLaunch.addCategory("android.intent.category.LAUNCHER");
Taken from this question: Bring application to front after user clicks on home button
I am trying to put this code in GCMIntentService.java from cordova push plugin. No matter where I put it, on compile i always get this error:
/appdir/android/src/com/plugin/gcm/GCMIntentService.java:94: error: cannot find symbol
Intent toLaunch = new Intent(getApplicationContext(), MainActivity.class);
^
symbol: class MainActivity
location: class GCMIntentService
Any ideas how to access this "MainActivity.class" from cordova plugin .java file?