Forum General

Android fail - NEED HELP

BeginnnnnerBeginnnnner Member ✭✭
edited January 2019 in General

Unhandled Exception:

This is what I get when i try to start new activity.

I want my Activity to look like this:

And here's the Activity code(just loads the images and textviews from linearlayout and changes string in the first textview):

namespace Maturitní_práce
[Activity(Label = "Activity3", Theme = "@style/Pozadi.Pozadi", ScreenOrientation = Android.Content.PM.ScreenOrientation.Landscape)]
public class Activity3 : Activity
ImageView ikona1, ikona2, ikona3, ikona4, ikona5;
TextView nick1, nick2, nick3, nick4, nick5;
protected override void OnCreate(Bundle savedInstanceState)


        ikona1 = FindViewById<ImageView>(Resource.Id.ikona1);
        ikona2 = FindViewById<ImageView>(Resource.Id.ikona2);
        ikona3 = FindViewById<ImageView>(Resource.Id.ikona3);
        ikona4 = FindViewById<ImageView>(Resource.Id.ikona4);
        ikona5 = FindViewById<ImageView>(Resource.Id.ikona5);
        nick1 = FindViewById<TextView>(Resource.Id.nick1);
        nick2 = FindViewById<TextView>(Resource.Id.nick2);
        nick3 = FindViewById<TextView>(Resource.Id.nick3);
        nick4 = FindViewById<TextView>(Resource.Id.nick4);
        nick5 = FindViewById<TextView>(Resource.Id.nick5);

        ikona3.Visibility = ViewStates.Gone;
        ikona4.Visibility = ViewStates.Gone;
        ikona5.Visibility = ViewStates.Gone;
        nick3.Visibility = ViewStates.Gone;
        nick4.Visibility = ViewStates.Gone;
        nick5.Visibility = ViewStates.Gone;

        nick1.Text = "hovno".ToString();



I don't know where is the mistake. I need the layout to look exatcly like on the picture, on the left there will be players nad names, in the bottom right corner will be the dice (this needs to be over the image of the game "desk") and in the background the game "desk". After I will need to create new layout over the desk again where the players will move. Any suggestions how to do that? Iam new to mobile programming


Sign In or Register to comment.