src/jpm/dg/HomeScreen.java
/**
	 * Launches the relevant screen after an image has been selected.
	 */
Launches the relevant screen after an image has been selected.
Launches the relevant screen after an image has been selected .
@Override
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
		if (resultCode == Activity.RESULT_OK) {
			Intent i;
			requestCode = (requestCode >= CAMERA_OFFSET) ? (requestCode - CAMERA_OFFSET)
					: requestCode;
			switch (requestCode) {
			case HIDE_TEXT:
				i = new Intent(getApplicationContext(), TextHideScreen.class);
				break;
			case RETRIEVE_TEXT:
				i = new Intent(getApplicationContext(),
						TextRetrieveScreen.class);
				break;
			default:
				i = new Intent(getApplicationContext(),
						ImageRetrieveScreen.class);
			}
			if (data.getData().toString() != null) {
				i.putExtra("imageUri", data.getData().toString());
				i.putExtra("isFromCamera", (requestCode >= CAMERA_OFFSET));
			}
			startActivity(i);
		}
	}
@ Override protected void onActivityResult ( int requestCode , int resultCode , Intent data ) { if ( resultCode == Activity . RESULT_OK ) { Intent i ; requestCode = ( requestCode >= CAMERA_OFFSET ) ? ( requestCode - CAMERA_OFFSET ) : requestCode ; switch ( requestCode ) { case HIDE_TEXT : i = new Intent ( getApplicationContext ( ) , TextHideScreen . class ) ; break ; case RETRIEVE_TEXT : i = new Intent ( getApplicationContext ( ) , TextRetrieveScreen . class ) ; break ; default : i = new Intent ( getApplicationContext ( ) , ImageRetrieveScreen . class ) ; } if ( data . getData ( ) . toString ( ) != null ) { i . putExtra ( "imageUri" , data . getData ( ) . toString ( ) ) ; i . putExtra ( "isFromCamera" , ( requestCode >= CAMERA_OFFSET ) ) ; } startActivity ( i ) ; } }
Launches the relevant screen after an image has been selected.
Launches the relevant screen after an image has been selected .
// Pass data to the intent.