package com.example.ccc;
import android.os.Bundle;
import android.app.Activity;
import android.widget.Toast;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
MyView v = new MyView(getApplicationContext());
//setContentView(v);
xxx();
}
public void xxx() {
Toast.makeText(MainActivity.this,"cars : aaaa",Toast.LENGTH_SHORT).show();
}
}
package com.example.ccc;
import android.widget.Toast;
import android.content.Context;
import android.graphics.*;
import android.view.View;
public class MyView extends View {
public MyView(Context context){
super(context);
}
protected void onDraw(Canvas canvas) {
Paint pt=new Paint();
pt.setColor(Color.GREEN);
canvas.drawCircle(100,100,80,pt);
}
public void xxx() {
// Toast.makeText(MainActivity.this,"cars : aaaa",Toast.LENGTH_SHORT).show();
}
}