示例#1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.addNews);
            // Create your application here
            name  = FindViewById <EditText>(Resource.Id.name);
            topic = FindViewById <EditText>(Resource.Id.topic);

            news   = FindViewById <EditText>(Resource.Id.news);
            submit = FindViewById <Button>(Resource.Id.submit);

            myAd = new AdminDatabase(this);
            myAd.OnCreate(datae);

            submit.Click += delegate
            {
                myAd.insertValue(name.Text, topic.Text, news.Text);
                //myAd.selectMydata(name.Text, topic.Text, news.Text);
                //myAd.OnCreate(datae);
                var value  = name.Text;
                var top    = topic.Text;
                var khabar = news.Text;
                System.Console.WriteLine("Text Value ---- > " + value);

                Intent newScreen = new Intent(this, typeof(displayActivity));
                newScreen.PutExtra("name", value);
                newScreen.PutExtra("top", top);
                newScreen.PutExtra("khabar", khabar);
                StartActivity(newScreen);



                //   //myDB.selectMydata(.Text, Password.Text);
                //   //var name = UserName.Text;
                //   SetContentView(Resource.Layout.dislay);
                //

                //   /*System.Console.WriteLine("Text Value ---- > " + name.Text);
                //   System.Console.WriteLine("Text Value ---- > " + topic.Text);
                //   System.Console.WriteLine("Text Value ---- > " + news.Text);*/
                //   Intent i = new Intent(this, typeof(displayActivity));
                //   StartActivity(i);
            };
        }
示例#2
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            cdm = new AdminDatabase(this.Activity);
            View myView = inflater.Inflate(Resource.Layout.FourtTabLayout, container, false);
            // SearchView mySearch = myView.FindViewById<SearchView>(Resource.Id.searchView1);
            ListView myList = myView.FindViewById <ListView>(Resource.Id.listID);

            //TextView mytext = myView.FindViewById<TextView>(Resource.Id.textView1);


            //myView.FindViewById<TextView>(Resource.Id.textView1).Text = myName;

            // mytext.Text = "Code List";
            //myList.Adapter = new ArrayAdapter(myContext, Android.Resource.Layout.SimpleListItem1, movieArray);

            // Code to display Code List

            ICursor myresult = cdm.PrintCodeList(this.Activity);


            listCode.Clear();

            while (myresult.MoveToNext())
            {
                //myEmail = myresult.GetString(myresult.GetColumnIndexOrThrow(emailValue));
                // working code

                title = myresult.GetString(myresult.GetColumnIndexOrThrow(name));
                link  = myresult.GetString(myresult.GetColumnIndexOrThrow(topic));
                disc  = myresult.GetString(myresult.GetColumnIndexOrThrow(news));

                listCode.Add(title);

                //custom Adaptor addition
            }
            myAdapterarray    = new ArrayAdapter(this.Activity, Android.Resource.Layout.SimpleListItem1, listCode);
            myList.Adapter    = myAdapterarray;
            myList.ItemClick += MyList_ItemClick;
            //mySearch.QueryTextChange += MySearch_QueryTextChange;
            return(myView);
        }