In my activity I want to start a class which extends an AndroidApplication class but I don't know how to do it. I want to call the onCreate method of the AndroidApplication class, of course.
public class MainActivity extends Activity { @Override public void onCreate(Bundle bundle) { super.onCreate(bundle); setContentView(R.layout.layout); new AndroidLauncher(); } } Here is the manifest:
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.utente.morramongame" android:versionCode="1" android:versionName="1.0"> <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="25"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.READ_PHONE_STATE"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/GdxTheme"> <application android:name=".AndroidLauncher"> </application> <activity android:name=".MainActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:label="@string/app_name" android:screenOrientation="landscape"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> </application>
onCreateis automatically called if you set the Application up correctlyApplicationis created by the framework. You never create it or any other Android component yourself.