1 of 1 people found this helpful
When creating an Android App, you can choose to use a different name than the default "MainActivity". Based on what name you give, both the java and the xml layout file will have the same name. For example, if you name the activity as "SampleActivity", the layout will have the name "activity_sample" by default.
For example, you will notice in BLE Robot Source Files that there is no "MainActivity.java" file. Hence, there won't be an "activity_main.xml".
To find out which activity is launched first, you need to check the AndroidManifest.xml file.
Here, you need to check for the intent filter which reads MAIN and LAUNCHER as shown below:
<activity android:name=".ScanActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity>
So, ScanActivity is actually the MainActivity or the activity that's going to be launched first.
Therefore the code is actually complete and there are no missing files. Hope this clears things out