I made an app for android. From CoronaApplication.java (that extends android.app.Application) I need to access the onWindowFocusChanged (that belongs to Activity)
In detail, I have
public class CoronaApplication extends android.app.Application {
in which, after searching a lot on the net, I found the registerActivityLifecycleCallbacks
so I add, in the (override) onCreate the follwing code:
Basically I need to override some method in the activity. But I can’t find the activity for my project!
In my AndroidManifest.XML I have:
\<application android:name="CoronaApplication" android:label="MyApp" android:hardwareAccelerated="true" android:debuggable="true" android:icon="@drawable/ic\_launcher"\> \<!-- The main Corona activity that runs the Corona project. --\> \<activity android:name="com.ansca.corona.CoronaActivity" android:screenOrientation="landscape" android:configChanges="keyboardHidden|orientation|screenSize" android:label="My App" android:launchMode="singleTask" android:theme="@android:style/Theme.NoTitleBar.Fullscreen"\> \<intent-filter\> \<action android:name="android.intent.action.MAIN" /\> \<category android:name="android.intent.category.LAUNCHER" /\> \</intent-filter\> \</activity\>
So I can find the Application (It’s located under com.mycompany.app/COronaApplication.java) and extends android.app.Application.
But I can’t find the main activity (in which I have to override some methods). The XML says that is com.ansca.corona.CoronaActivity, but I can’t find this java file…
When, for test purpose, I created a blank app with file->new->Android Application Project, a java class that extends Activity is created, and I can work on it…
Anyone knows how can I access the Activity class for my corona app???
I followed you post (I think…) I made a class, FullscreenActivity.java, and put it in the same folder (com.mycompany.com) where are present AppManager.java and CoronaApplication.java.
I modifiy the constructor of this class in
public class FullscreenActivity extends com.ansca.corona.CoronaActivity
but this method
@Override public void onWindowFocusChanged (boolean hasFocus) { }
is never fired…
I also tried to add in AndroidManifest.xml the new activity
Basically I need to override some method in the activity. But I can’t find the activity for my project!
In my AndroidManifest.XML I have:
\<application android:name="CoronaApplication" android:label="MyApp" android:hardwareAccelerated="true" android:debuggable="true" android:icon="@drawable/ic\_launcher"\> \<!-- The main Corona activity that runs the Corona project. --\> \<activity android:name="com.ansca.corona.CoronaActivity" android:screenOrientation="landscape" android:configChanges="keyboardHidden|orientation|screenSize" android:label="My App" android:launchMode="singleTask" android:theme="@android:style/Theme.NoTitleBar.Fullscreen"\> \<intent-filter\> \<action android:name="android.intent.action.MAIN" /\> \<category android:name="android.intent.category.LAUNCHER" /\> \</intent-filter\> \</activity\>
So I can find the Application (It’s located under com.mycompany.app/COronaApplication.java) and extends android.app.Application.
But I can’t find the main activity (in which I have to override some methods). The XML says that is com.ansca.corona.CoronaActivity, but I can’t find this java file…
When, for test purpose, I created a blank app with file->new->Android Application Project, a java class that extends Activity is created, and I can work on it…
Anyone knows how can I access the Activity class for my corona app???
I followed you post (I think…) I made a class, FullscreenActivity.java, and put it in the same folder (com.mycompany.com) where are present AppManager.java and CoronaApplication.java.
I modifiy the constructor of this class in
public class FullscreenActivity extends com.ansca.corona.CoronaActivity
but this method
@Override public void onWindowFocusChanged (boolean hasFocus) { }
is never fired…
I also tried to add in AndroidManifest.xml the new activity