[mono-android] "Hello World" does not display
Madhuri Mittal
madhuri.mittal at gmail.com
Mon Mar 21 15:31:26 EDT 2011
Hi,
I just started using MonoDroid - I have the "Hello World" code , however
when I run it emulator using different platforms I get the message saying
"Deployment Suceeded" however I never see the "Hello World" text anywhere on
the screen as shown on tutorials . Below is my code- any reason why this may
be happening?
using System;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
namespace MonoAndroidApplication1
{
[Activity(Label = "MonoAndroidApplication1", MainLauncher = true)]
public class Activity1 : Activity
{
int count = 1;
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
//// Set our view from the "main" layout resource
//SetContentView(Resource.Layout.Main);
//// Get our button from the layout resource,
//// and attach an event to it
//Button button = FindViewById<Button>(Resource.Id.MyButton);
//button.Click += delegate { button.Text = string.Format("{0}
clicks!", count++); };
var tv = new TextView(this);
tv.Text = "Hello, World";
SetContentView(tv);
}
}
}
Thanks
Madhuri
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/mailman/private/monodroid/attachments/20110321/8708637e/attachment.html
More information about the Monodroid
mailing list