Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Replacing the Action Bar

$
0
0

I am using the doc from this page "Replacing the Action Bar" on Microsoft docs.

My Activity is subclassed from Activity because I do not need to support before Android API level 27 (so no AppCompatActivity or using Android.Support.V7.App;)

This line:
var toolbar = FindViewById(Resource.Id.toolbar);

Gives me System.InvalidCastException: 'Unable to convert instance of type 'Android.Views.ViewGroupInvoker' to type 'Android.Widget.Toolbar'.'

Why does the documented approach not work?


Viewing all articles
Browse latest Browse all 204402


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