There is a DrawerLayout, there are several elements in the list, and for each click a new activity is opened. So at startup, the main activity should be launched, but the one that is listed first in the list should be launched.
Here is the code:
private void selectItem(int position) { switch(position) { case 0: Intent intent = new Intent(MainActivity.this, Two.class); startActivity(intent); break; сase 1: Intent intent ... In general, when you start the program, the Two class opens, everything is fine in the program settings, everything is written in the manifest, but I can't make it
Intent intent = new Intent(MainActivity.this, MainActivity.class); Here is part of the manifesto. I thought at first, this is a trifle, but in the end something stuck on it.
<activity android:name=".MainActivity" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity>