Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion app/src/main/java/com/example/myapplication/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,19 @@ import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle

class MainActivity : AppCompatActivity() {

var firstName: String = ""
var lastName: String = ""
var Phone_Number: String = ""
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
}
}

fun SetUpProfileData() {
firstName = "Purvesh"
lastName = "Doodiya"
Phone_Number = "9876543121"
}

}
Copy link
Copy Markdown

@github-actions github-actions bot Apr 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AIReviewRadar

The changes seem fine. However, it would be better to add access modifiers to the variables firstName, lastName, and Phone_Number. Also, the function name SetUpProfileData should be in lower camel case as setUpProfileData.

Here's the updated code:

@@ -4,8 +4,19 @@ import androidx.appcompat.app.AppCompatActivity
 import android.os.Bundle
 
 class MainActivity : AppCompatActivity() {
+
-    var firstName: String = ""
-    var lastName: String = ""
-    var Phone_Number: String = ""
+    private var firstName: String = ""
+    private var lastName: String = ""
+    private var phoneNumber: String = ""
 
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         setContentView(R.layout.activity_main)
     }
+
+    fun setUpProfileData() {
+        firstName = "Purvesh"
+        lastName = "Doodiya"
+        phoneNumber = "9876543121"
+    }
+
+}

Please make these changes and re-submit the patch.