Exemplo n.º 1
0
        //###################################################################################

        protected override void OnCreate(Bundle savedInstanceState)
        {
            //Statischen Speicher wiederherstellen, wenn im Hintergrund vom System gelöscht
            if (TBL.SP_Object == null)
            {
                Activity_Init.InitRoutine(this);
            }

            SetTheme(Resource.Style.AppTheme);
            base.OnCreate(savedInstanceState);

            //entryFeed
            string entryID = Intent.GetStringExtra(BUNDLE_ENTRYKEY);

            if (savedInstanceState != null)
            {
                entryID = savedInstanceState.GetString(BUNDLE_ENTRYKEY, "");
            }
            _currentEntry = TBL.GetFeedEntry(entryID);

            if (_currentEntry == null)
            {
                Finish(); return;
            }

            //Layout füllen
            SetContentView(Resource.Layout.activity_feedEntry);

            CreateViewholder();
            CreateToolbar();
        }
Exemplo n.º 2
0
        private void AttachmentAdapter_EntrySelected(object sender, Adapters.ListFeedAttachmentAdapterEntrySelected e)
        {
            EntryAttachment attachment = TBL.GetFeedEntry(e.EntryKey)?.GetAttachment(e.AttachmentKey);

            if (attachment.IsDownloadable)
            {
                bool success = Helper.FileOpen.Open(this, attachment.LocalFilePath);
                if (!success)
                {
                    AttachmentAdapter_AttachmentRetrieveError(null, new Adapters.AttachmentRetrieveErrorEventArgs(Adapters.AttachmentRetrieveErrorReason.RETRIEVE_ERROR));
                }
            }
            else
            {
                bool success = Helper.FileOpen.OpenWeb(this, attachment.RemoteURL);
                if (!success)
                {
                    AttachmentAdapter_AttachmentRetrieveError(null, new Adapters.AttachmentRetrieveErrorEventArgs(Adapters.AttachmentRetrieveErrorReason.RETRIEVE_ERROR));
                }
            }
        }