This is an initialization question for Android Studio variables.

Asked 2 years ago, Updated 2 years ago, 117 views

I am Corin who is studying hard because I am interested in making an application. It's hard to apply for a book When I looked up the onCreate() in question, it seemed like the first automatically declared function like Java's main method... The question is whether there is a problem if all variables are initialized in create. I'm an outsider in Java, so please help me What does it mean that oncreate must be overwritten? I looked it up and I think the terms overwrite and overload are derived from Java, is that right? Is it right to study Java first?

java oncreate

2022-09-22 14:02

1 Answers

OnCreate() is a function such as init() in Java, and its role varies slightly depending on the properties of the class created. First of all, for general activity, onCreate by default allows all objects to be initialized and declared. Fragment allows you to initialize and declare almost any object except those with View properties. The Service can initialize and declare almost any object. You will be able to enjoy coding if you read Java carefully and proceed with Android at the same time.


2022-09-22 14:02

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.