1) Here is the main activity class form where i get the handle to the
view from xml:-

@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);

        setContentView(R.layout.main);


        mGameStart = true;




        // get handles to the Balls from XML, and its Thread


        mBalls = (Balls) findViewById(R.id.balls);



2) here is the view class
public class Balls extends View{

        private static final String TAG = "BallsView";

    private int mMode = READY;
    public static final int PAUSE = 0;
    public static final int READY = 1;
    public static final int RUNNING = 2;
    public static final int LOSE = 3;

        private final Paint mPaint = new Paint();

        public Balls(Context context, AttributeSet attrs, int defStyle){
        super(context, attrs, defStyle);
        setFocusable(true);
        setWillNotDraw(false);


        }
        public Balls(Context context, AttributeSet attrs) {
                super(context, attrs);
                 setFocusable(true);
                 setWillNotDraw(false);
        }

     @Override
    public void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        Log.w(this.getClass().getName(),"Just before circle draw");

                canvas.drawCircle(100, 150, 5,mPaint);

    }


On Sep 28, 1:56 pm, TreKing <[email protected]> wrote:
> On Wed, Sep 28, 2011 at 12:23 PM, ruchira <[email protected]> wrote:
> > Any suggestions please??
>
> Post some code?
>
> ---------------------------------------------------------------------------­----------------------
> TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
> transit tracking app for Android-powered devices

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

Reply via email to