Android Open Source - crop Main Activity

From Project

Back to project page crop.


The source code is released under:

Apache License

If you think the Android project crop listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.example.cropsample;
//  ww  w .ja  va  2 s . c o m
import android.content.Intent;
import android.os.Environment;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;

public class MainActivity extends ActionBarActivity {

  protected void onCreate(Bundle savedInstanceState) {

    findViewById( View.OnClickListener() {
      public void onClick(View v) {
        Intent cropIntent = new Intent(getApplicationContext(), BackgroundImageMakerActivity.class);
        startActivityForResult(cropIntent, 0x1234);

  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (data != null && requestCode == 0x1234) {
      String path = data.getStringExtra("PATH");
      ImageView imageView = (ImageView) findViewById(;

Java Source Code List