Created
April 27, 2011 03:04
-
-
Save agiletalk/943646 to your computer and use it in GitHub Desktop.
[예제] 간단한 커스텀 위젯
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CustomView extends Activity { | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
MyView vw = new MyView(this); | |
setContentView(vw); | |
} | |
protected class MyView extends View { | |
public MyView(Context context) { | |
super(context); | |
} | |
public void onDraw(Canvas canvas) { | |
Paint Pnt = new Paint(); | |
Pnt.setColor(Color.BLUE); | |
canvas.drawColor(Color.WHITE); | |
canvas.drawCircle(100, 100, 80, Pnt); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment