| 39 | |
| 40 | |
| 41 | public class MainActivity extends Activity implements View.OnClickListener |
| 42 | { |
| 43 | private static final String TAG = MainActivity.class.getSimpleName(); |
| 44 | |
| 45 | private static final int REQUEST_COLLAGE_IMAGE_ACTIVITY = 1; |
| 46 | private static final int REQUEST_CROP_IMAGE_ACTIVITY = 2; |
| 47 | private static final int REQUEST_COLOR_BALANCE_ACTIVITY = 3; |
| 48 | private static final int REQUEST_MAKEUP_ACTIVITY = 4; |
| 49 | private static final int REQUEST_EFFECT_ACTIVITY = 5; |
| 50 | |
| 51 | @Override |
| 52 | protected void onCreate(Bundle savedInstanceState) |
| 53 | { |
| 54 | super.onCreate(savedInstanceState); |
| 55 | setContentView(R.layout.main_activity); |
| 56 | |
| 57 | |
| 58 | findViewById(R.id.makeup).setOnClickListener(this); |
| 59 | } |
| 60 | |
| 61 | private Intent gotoGallery(int picture_count) |
| 62 | { |
| 63 | return GalleryActivity.startGalleryActivity(this, picture_count); |
| 64 | } |
| 65 | |
| 66 | @Override |
| 67 | public void onClick(View view) |
| 68 | { |
| 69 | switch(view.getId()) |
| 70 | { |
| 71 | case R.id.makeup: |
| 72 | startActivityForResult(gotoGallery(1), REQUEST_MAKEUP_ACTIVITY); |
| 73 | break; |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | @Override |
| 78 | protected void onActivityResult(final int requestCode, final int resultCode, final Intent data) |
| 79 | { |
| 80 | if(resultCode != RESULT_OK) |
| 81 | { |
| 82 | Log.w(TAG, "What's happening here?"); |
| 83 | return; |
| 84 | } |
| 85 | |
| 86 | Intent intent = new Intent(); |
| 87 | intent.putExtras(data); |
| 88 | |
| 89 | switch(requestCode) |
| 90 | { |
| 91 | case REQUEST_MAKEUP_ACTIVITY: |
| 92 | intent.setClass(this, MakeupActivity.class); |
| 93 | startActivity(intent); |
| 94 | break; |
| 95 | default: |
| 96 | super.onActivityResult(requestCode, resultCode, data); |
| 97 | break; |
| 98 | } |
nothing calls this directly
no outgoing calls
no test coverage detected