Advertisement
Guest User

Untitled

a guest
Nov 11th, 2018
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. class TestFragment : Fragment() {
  2.  
  3. override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
  4. return inflater.inflate(R.layout.fragment_test, container, false)
  5. }
  6.  
  7. }
  8.  
  9. class TestActivity : AppCompatActivity() {
  10.  
  11. override fun onCreate(savedInstanceState: Bundle?) {
  12. super.onCreate(savedInstanceState)
  13. setContentView(R.layout.activity_test)
  14.  
  15. supportFragmentManager
  16. .beginTransaction()
  17. .replace(R.id.container, TestFragment())
  18. .commit()
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement