Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.example.carloschaves.sorte
- import android.support.v7.app.AppCompatActivity
- import android.os.Bundle
- import android.view.View
- import android.widget.RemoteViews
- import android.widget.TextView
- import java.util.*
- class MainActivity : AppCompatActivity() {
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- setContentView(R.layout.activity_main)
- }
- fun sorteio (view: View){
- var texto = findViewById(R.id.textoSorteio) as TextView
- var numeroSorteado = Random().nextInt(11)
- texto.setText("Este é o número da sorte: $numeroSorteado")
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement