Ejemplo n.º 1
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    final Intent sharedIntent = getIntent();
    final String action = sharedIntent.getAction();

    ArrayList<Uri> uris = null;
    if (Intent.ACTION_SEND.equals(action)) {
      Uri uri = sharedIntent.getParcelableExtra(Intent.EXTRA_STREAM);
      if (null != uri) {
        uris = new ArrayList<Uri>();
        uris.add(uri);
      }
    } else if (Intent.ACTION_SEND_MULTIPLE.equals(action)) {
      uris = sharedIntent.getParcelableArrayListExtra(Intent.EXTRA_STREAM);
    }

    if (null != uris && !uris.isEmpty()) {
      PhotoUploadController controller =
          PhotupApplication.getApplication(this).getPhotoUploadController();
      for (Uri uri : uris) {
        controller.addSelection(PhotoUpload.getSelection(uri));
      }
    }

    Intent intent = new Intent(this, PhotoSelectionActivity.class);
    intent.putExtra(PhotoSelectionActivity.EXTRA_DEFAULT_TAB, PhotoSelectionActivity.TAB_SELECTED);
    startActivity(intent);

    finish();
  }
Ejemplo n.º 2
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    addPreferencesFromResource(R.xml.main_prefs);

    Account mainAccount = PhotupApplication.getApplication(this).getMainAccount();
    if (null != mainAccount) {
      mainAccount.getAlbums(getApplicationContext(), this, false);
    }

    populateFiltersPref();
  }
Ejemplo n.º 3
0
 @Override
 protected void onStop() {
   super.onStop();
   PhotupApplication.getApplication(this).checkInstantUploadReceiverState();
 }