Click here to Skip to main content
15,895,709 members
Articles / Mobile Apps / Android

Drawing in Android

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
29 Nov 2012CPOL10 min read 30.5K   965   13  
2D Drawing in Android
package com.hfk.yadd;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.RadioGroup;

public class CameraTransformationRotateXConfigActivity extends Activity {

	public static final String TRANSFORMATION_ROTATEX = "ROTATEX";
	public static final String ROTATEX_ANGLE = "ROTATEX_ANGLE";
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {

		super.onCreate(savedInstanceState);		
		setContentView(R.layout.cameratransform_rotatex_config);
        
		mTextAngle = (EditText)findViewById(R.id.editAngleX);
        
        Bundle data = getIntent().getExtras();
        if(data != null){        	
        	if(data.containsKey(ROTATEX_ANGLE)) {
        		mTextAngle.setText(Float.toString(data.getFloat(ROTATEX_ANGLE)));        		
        	}

        }		
	}

	@Override
	public void onBackPressed() {
	    Intent result = new Intent();

	    Bundle b = new Bundle();
	    b.putString(CustomDrawableCameraTransformationConfigActivity.TRANSFORMATION_TYPE, TRANSFORMATION_ROTATEX);    
	    b.putFloat(ROTATEX_ANGLE, Float.parseFloat(mTextAngle.getText().toString()));

	    result.putExtras(b);

	    setResult(Activity.RESULT_OK, result);
	    
	    super.onBackPressed();
	}

	private EditText mTextAngle;
	
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Belgium Belgium
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions