package ee.bcs.telefon.jaagup; import android.os.Bundle; import android.app.Activity; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.view.Display; import android.view.Menu; import android.view.View; import android.widget.ImageView; public class JoonistusActivity extends Activity { ImageView imageView; Bitmap bitmap; Canvas canvas; Paint paint; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_joonistus); imageView=(ImageView)findViewById(R.id.imageView1); Display d=getWindowManager().getDefaultDisplay(); bitmap=Bitmap.createBitmap(d.getWidth(), d.getHeight(), Bitmap.Config.ARGB_8888); canvas=new Canvas(bitmap); paint=new Paint(); paint.setColor(Color.GREEN); canvas.drawLine(0, 0, 100, 100, paint); imageView.setImageBitmap(bitmap); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.joonistus, menu); return true; } public void nupu1Vajutus(View v){ Intent vahendaja=new Intent(this, MainActivity.class); startActivity(vahendaja); } }