try change code to "extends ActivityView"

On Oct 15, 4:12 pm, Chihau Chau <chi...@gmail.com> wrote:
> I have updated from SDK 1.5 to 1.6 and I am trying to use a ProgressBar View
> but Eclipse show a error "Cannot cast from View to ProgressBar".
> This is my code:
>
> package cl.chihau.progressbar;
>
> import android.app.Activity;
>
> import android.os.Bundle;
>
> import android.os.Handler;
>
> public class ProgressBar extends Activity {
>
>     /** Called when the activity is first created. */
>
>  private static int progress = 0;
>
>     private ProgressBar progressBar;
>
>     private int progressStatus = 0;
>
>     private Handler handler = new Handler();
>
>     @Override
>
>     public void onCreate(Bundle savedInstanceState) {
>
>         super.onCreate(savedInstanceState);
>
>         setContentView(R.layout.main);
>
>         /* The error is in the following line */
>
>         progressBar = (ProgressBar) findViewById(R.id.progressbar);
>
>     }
>
> }
>
> --
> Chihau Chau
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to