The application that I'm working on requires me to extend drawable and
then place this custom drawable inside an ImageView for displaying.
I've simplified my code as much as possible but still I only get a
black screen.

The draw() method of my drawable class is:

        public void draw(Canvas canvas) {
                setBounds(0,0,150, 150);
                p.setColor(Color.WHITE);
                p.setStrokeWidth(5f);
                p.setStyle(Paint.Style.STROKE);
                p.setAntiAlias(true);

                canvas.drawLine(10, 50, 100, 50, p);
        }

And the activity is:

            public void onCreate(Bundle savedInstanceState) {

                super.onCreate(savedInstanceState);

                GraphViewDrawable graphViewDrawable = new
GraphViewDrawable();

                myLin = new LinearLayout(this);
                image = new ImageView(this);

                image.setImageDrawable(graphViewDrawable);
                myLin.addView(image);

                setContentView(myLin);

            }

Why is nothing shown?

-- 
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