visageSDK
VisageTrackerDemo/app/src/main/java/com/visagetechnologies/visagetrackerdemo/ImagesActivity.java
1 package com.visagetechnologies.visagetrackerdemo;
2 
3 import android.app.Activity;
4 import android.content.Intent;
5 import android.database.Cursor;
6 import android.view.WindowManager;
7 import android.net.Uri;
8 import android.os.Bundle;
9 import android.provider.MediaStore;
10 
11 
15 public class ImagesActivity extends Activity
16 {
17  private static int RESULT_LOAD_IMAGE = 1;
18 
22  @Override
23  public void onCreate(Bundle savedInstanceState) {
24  super.onCreate(savedInstanceState);
25  getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
26 
27  Intent i = new Intent(
28  Intent.ACTION_PICK,
29  android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
30 
31  startActivityForResult(i, RESULT_LOAD_IMAGE);
32 
33  }
34 
38  @Override
39  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
40  super.onActivityResult(requestCode, resultCode, data);
41 
42  if (requestCode == RESULT_LOAD_IMAGE && resultCode == RESULT_OK && null != data) {
43  Uri selectedImage = data.getData();
44 
45  Intent intent = new Intent(this, TrackerActivity.class);
46 
47  Bundle bundle = new Bundle();
48  bundle.putString("imageURI", selectedImage.toString());
49  bundle.putInt("type", 1);
50 
51  intent.putExtras(bundle);
52  startActivity(intent);
53  }
54  finish();
55 
56  }
57 }
Activity called to initiate and control tracking for either tracking from camera or image...
void onCreate(Bundle savedInstanceState)
Implementation of onCreate method provided by Activity interface.