Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

Remove all views from activity

$
0
0

I use method AddContentView for add my view in Activity:

    protected override void OnCreate (Bundle bundle)
    {
        base.OnCreate (bundle);
        global::Xamarin.Forms.Forms.Init (this, bundle);
        LoadApplication (new App());
            this.AddContentView (myView, layoutPararms);
        }

    protected override void OnBackPressed ()
    {
            this.RemoveAllViews() //this method does not contain in Activity
        }

I press 'back' button and open my application many times.
The memory overflows because I add view in Activity every time in OnCreate method.
How can I remove all views from activity?


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>