Can you tell me if this back button is implemented properly? I am returning to my code…
Jump to turn (8)
- 1Can you tell me if this back button is implemented properly? I am returning to m
- 2If my pullrequest got comments on it(Github), how can I make amends in the same
- 3How should I go about making a certain period of the day my designated study tim
- 4Anything to add if I probably have adhd and anxiety?
- 5Could you give me more details on 5.?
- 6I was told to make the dimensions in the following code be dividable by 4 or pre
- 7The last part is what I'm concerned about - this will definitely change the layo
- 8Btw why was paddingTop in Header's textview passed when giving substitute dimens
- User
Can you tell me if this back button is implemented properly? I am returning to my code after a month of blank so I'm unsure: "class SettingsActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_settings)
codeval backButton = findViewById<ImageButton>(R.id.back_button) backButton.setOnClickListener { finish() } }} "
- Assistant
Yes, the code you provided looks correct for implementing a back button in an Android activity.
In the
onCreatemethod,setContentViewis used to set the layout for the activity. The code also finds the with the ID using .