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

Activity in library doesn't work, someone please help ?

$
0
0

I have used Winforms and WPF earlier and I am not sure if this is the right way to achieve the result I am working on.

I put my activity in a android c# library (xamarin.android) and create a android project. The code is not working

Java.Lang.RuntimeException: Binary XML file line #1: You must supply a layout_width attribute.

[Activity(Label = "MainActivity", MainLauncher = true)] public class MainActivity : Activity { protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.MainActivity); // Create your application here } }

`<?xml version="1.0" encoding="utf-8"?>


`

Someone please tell me what is going wrong in my code. I read on stackoverflow.com that I need to register my acitivity in mainfest. If I need to do that how I can do it in xamarin. If I am wrong please help me to use activity and code from a library.

@TechieRathore @JamesMontemagno @PierceBoggan


Viewing all articles
Browse latest Browse all 204402

Trending Articles



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