Tuesday, July 26, 2011

[android-developers] Application stop unexpectedly

I am receiving application stopped unexpectedly from the following
piece of code. Can someone help

package pkg.navigate;

import android.app.Activity;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.widget.TextView;

public class navigateActivity extends Activity {
/** Called when the activity is first created. */
TextView txtView = (TextView)this.findViewById(R.id.textview);

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

new CountDownTimer(30000, 1000) {
public void onTick(long millisUntilFinished) {
txtView.setText("Waiting for "+ millisUntilFinished/1000
+ " seconds");
}
public void onFinish() {
txtView.setText("Finished!!!");
}
}.start();
}
}

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment