Ejemplo n.º 1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            //Account = DBAccountManager.GetInstance (ApplicationContext, AppKey, AppSecret);
            chooser = new DBChooser (dropboxAppKey);
            SetContentView (Resource.Layout.Main);
            Button button = FindViewById<Button> (Resource.Id.myButton);
            //Button button2 = FindViewById<Button> (Resource.Id.myButton2);
            //ImageView imageView = FindViewById<ImageView> (Resource.Id.myImageView);

            button.Click += delegate {
                var imageIntent = new Intent ();
                imageIntent.SetType ("image/*");
                imageIntent.SetAction (Intent.ActionGetContent);
                StartActivityForResult (
                Intent.CreateChooser (imageIntent, "Select photo"), 0);
            };
            FindViewById<Button> (Resource.Id.btnDirect).Click += delegate {
                chooser.ForResultType (DBChooser.ResultType.DirectLink).Launch (this, dropboxRequest);
            };

            FindViewById<Button> (Resource.Id.btnPreview).Click += delegate {
                //ListAdapter =  FindViewById<ListView>(Resource.Id.list);
                var ListView = new Intent (this, typeof(ListView));

                StartActivity(ListView);
                //SetContentView(Resource.Layout.build);
                //Context context = new Context();
            //				Intent intent = new Intent(this, ListView.GetObject);
            //				startActivity(intent);
            };

            items = new List<image.Item> ();
        }
Ejemplo n.º 2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

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

            chooser = new DBChooser (dropboxAppKey);

            // Get our button from the layout resource,
            // and attach an event to it
            FindViewById<Button> (Resource.Id.btnDirect).Click += delegate {
                chooser.ForResultType (DBChooser.ResultType.DirectLink).Launch (this, dropboxRequest);
            };

            FindViewById<Button> (Resource.Id.btnPreview).Click += delegate {
                chooser.ForResultType (DBChooser.ResultType.PreviewLink).Launch (this, dropboxRequest);
            };

            FindViewById<Button> (Resource.Id.btnLocal).Click += delegate {
                chooser.ForResultType (DBChooser.ResultType.FileContent).Launch (this, dropboxRequest);
            };

            items = new List<Item> ();
        }