Created
March 27, 2020 11:05
Android Studio - Tabbed Activity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.dm.tutorialtabactivity | |
import android.os.Bundle | |
import androidx.fragment.app.Fragment | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
import kotlinx.android.synthetic.main.fragment1.* | |
/** | |
* A simple [Fragment] subclass. | |
*/ | |
class Fragment1 : Fragment() { | |
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,savedInstanceState: Bundle?): View? { | |
// Imposta il layout per questo frammento | |
return inflater.inflate(R.layout.fragment1, container, false) | |
} | |
//funzione principale dove inserire il proprio codice | |
override fun onResume() { | |
super.onResume() | |
//inserire qui il proprio codice | |
//gestione del pulsante con id=button | |
button.setOnClickListener { | |
textView.text = "Tab1" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment