Ejemplo n.º 1
0
  private void finishWithPath(String path) {
    if (pathSettingKey != null && !pathSettingKey.isEmpty()) {
      SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
      SharedPreferences.Editor editor = settings.edit();
      editor.putString(pathSettingKey, path);
      editor.commit();
    }

    Intent intent = new Intent();
    intent.putExtra("PATH", path);
    setResult(RESULT_OK, intent);
    finish();
  }
 @Override
 protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
   if (requestCode == FILECHOOSER_RESULTCODE) { // found this from StackOverflow
     if (null == mUploadMessage) return;
     Uri result = intent == null || resultCode != RESULT_OK ? null : intent.getData();
     mUploadMessage.onReceiveValue(result);
     mUploadMessage = null;
   } else {
     // -----------I wrote this code below this line----------------------------------
     jpegData = intent.getExtras().getByteArray("image");
     Bitmap img = BitmapFactory.decodeByteArray(jpegData, 0, jpegData.length);
     Drawable d = new BitmapDrawable(img);
     profilePicture.setBackground(d);
   }
 }
Ejemplo n.º 3
0
        @Override
        public void onFinish() {
          Intent intent;

          if (mPref.getCheckedTutorial() == true) {
            // 튜토리얼을 했을 경우
            intent = new Intent(AC_Loading.this, AC_Main.class);
          } else {
            // 튜토리얼을 안했을 경우
            intent = new Intent(AC_Loading.this, AC_Help_tutorial.class);
          }
          intent.putExtra("tutorial", true);
          intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
          startActivity(intent);
          overridePendingTransition(R.anim.fadein, R.anim.fadeout);
          cTimer.cancel();
          finish();
        }