TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
sasa lazic
NA
104
49.8k
C# android timer dont work
Jul 5 2013 1:59 PM
I try to make timer in android app.
This is code.
Doesn't work
public class Activity1 : Activity
{
int count = 1;
TextView txv1;
System.Timers.Timer t1;
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);
txv1 = FindViewById<TextView>(Resource.Id.textView7);
DateTime dt = DateTime.Now;
//txv1.Text = dt.ToShortTimeString();
txv1.Text = dt.ToLongTimeString();
t1 = new System.Timers.Timer(100);
t1.Elapsed += new ElapsedEventHandler(OnTimeEvent);
//t1.Interval = 100;
t1.Enabled = true;
t1.Start();
}
private void OnTimeEvent(object source, ElapsedEventArgs e)
{
txv1.Text = count.ToString();
count++;
}
I need help.
Thanks
Reply
Answers (
1
)
Backgroud of android Camera
Android Applications using visual studio 2008