+ 2

Can somebody explain this? I'm not understanding this from android studio.

package com.example.colrhodes.myapplication; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } } (This doesn't seem to be normal java code for me. I've studied basics of java.)

9th Mar 2018, 10:44 AM
Col Rhodes
5 Antworten
+ 3
package import class Mainactivity - your first run activity oncreate method- first run method as main method.
9th Mar 2018, 10:48 AM
Hasan Jafarov
Hasan Jafarov - avatar
+ 3
If a class inherits a method from its superclass, then there is a chance to override the method
9th Mar 2018, 11:01 AM
Hasan Jafarov
Hasan Jafarov - avatar
+ 2
@Hasan. Could you explain it more deeply? I cant get what is meant be "override" and more
9th Mar 2018, 10:54 AM
Gokul Nagarajan
Gokul Nagarajan - avatar
+ 2
MainActivity is your first class and the first action that is run by default when the program is started. And this in your case expands from the AppCompat support library. In onCreate, the activity and layout are created. setContentView is responsible for the layout, that is, for the appearance. A Bundle is designed for data storage
9th Mar 2018, 10:58 AM
Aidos Zhakupov
Aidos Zhakupov - avatar
+ 1
I advise reading books on Android. I personally advise: The Busy Coder's Guide to Android Development 8.10
9th Mar 2018, 11:03 AM
Aidos Zhakupov
Aidos Zhakupov - avatar