示例#1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.score);
            txt  = FindViewById <TextView>(Resource.Id.txt);
            back = FindViewById <Button>(Resource.Id.btnback);
            // Create your application here
            dataStore = new DataStore(this);

            list = new List <catpojo>();

            list = dataStore.getscore(this);

            // Toast.MakeText(this, "" + list.Count, ToastLength.Long).Show();

            for (int i = 0; i < list.Count; i++)
            {
                c       = new catpojo();
                c.Subid = list[i].Subid;
                c.Name  = list[i].Name;

                txt.Text = txt.Text + "\n" + c.Name + " " + c.Subid;
            }

            back.Click += (s, e) => {
                StartActivity(new Intent(this, typeof(Category)));
                Finish();
            };
        }
示例#2
0
        public void insercat(Context context, catpojo c)
        {
            SQLiteDatabase db            = new DataStore(context).WritableDatabase;
            ContentValues  contentValues = new ContentValues();

            contentValues.Put(SubcatID, c.Subid);
            contentValues.Put(ColumnName, c.Name);

            db.Insert(TableName, null, contentValues);
            db.Close();
        }
示例#3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);


            wordLayout = FindViewById <LinearLayout>(Resource.Id.word);
            letters    = FindViewById <GridView>(Resource.Id.letters);

            uname     = Intent.GetStringExtra("name");
            dataStore = new DataStore(this);

            dataStore.deleterecord(this);

            list = new List <catpojo>();

            //  Toast.MakeText(this, "" + Intent.GetStringExtra("sid"), ToastLength.Long).Show();



            for (int i = 0; i < subcatdata.Length; i++)
            {
                c       = new catpojo();
                c.Subid = subcatdata[i];
                c.Name  = catdata[i];
                dataStore.insercat(this, c);
            }



            list = dataStore.getcat(this, Intent.GetStringExtra("sid"));

            rand     = new Random();
            currWord = "";



            bodyParts    = new ImageView[numParts];
            bodyParts[0] = FindViewById <ImageView>(Resource.Id.head);
            bodyParts[1] = FindViewById <ImageView>(Resource.Id.body);
            bodyParts[2] = FindViewById <ImageView>(Resource.Id.arm1);
            bodyParts[3] = FindViewById <ImageView>(Resource.Id.arm2);
            bodyParts[4] = FindViewById <ImageView>(Resource.Id.leg1);
            bodyParts[5] = FindViewById <ImageView>(Resource.Id.leg2);


            playGame();
            //  Toast.MakeText(this, "" + list.Count, ToastLength.Long).Show();
        }