Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package hu.bme.aut.sportislife.food;
- import androidx.appcompat.app.AppCompatActivity;
- import android.os.Bundle;
- import android.widget.TextView;
- import java.util.Random;
- import hu.bme.aut.sportislife.R;
- import hu.bme.aut.sportislife.data.RaceEventsItem;
- public class Dinner extends AppCompatActivity {
- TextView menu = (TextView)findViewById(R.id.dinnermenu);
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_dinner);
- final int random = new Random().nextInt(5) + 1;
- switch (random) {
- case 1:
- menu.setText("Csulok");
- break;
- case 2:
- menu.setText("Alma");
- break;
- case 3:
- menu.setText("Körte");
- break;
- case 4:
- menu.setText("Narancs");
- break;
- case 5:
- menu.setText("Cékla");
- break;
- }
- }
- }
- /*
- //ez itt a layout
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical"
- android:background="@drawable/deszka"
- android:padding="16dp">
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="EGÉSZSÉGES TÁPANYAGOK:"
- android:textAllCaps="true"
- android:textColor="#F8F7F7"
- android:textSize="34sp" />
- <TextView
- android:id="@+id/dinnermenu"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginBottom="20dp"
- android:text="Túró"
- android:textColor="#F8F7F7"
- android:textSize="20sp" />
- </LinearLayout>
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement