久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <tfoot id='FDM8U'></tfoot>
    1. <i id='FDM8U'><tr id='FDM8U'><dt id='FDM8U'><q id='FDM8U'><span id='FDM8U'><b id='FDM8U'><form id='FDM8U'><ins id='FDM8U'></ins><ul id='FDM8U'></ul><sub id='FDM8U'></sub></form><legend id='FDM8U'></legend><bdo id='FDM8U'><pre id='FDM8U'><center id='FDM8U'></center></pre></bdo></b><th id='FDM8U'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='FDM8U'><tfoot id='FDM8U'></tfoot><dl id='FDM8U'><fieldset id='FDM8U'></fieldset></dl></div>

        • <bdo id='FDM8U'></bdo><ul id='FDM8U'></ul>

        <small id='FDM8U'></small><noframes id='FDM8U'>

      1. <legend id='FDM8U'><style id='FDM8U'><dir id='FDM8U'><q id='FDM8U'></q></dir></style></legend>

        我想制作一個像 WhatsApp Profile Photo Dialog Screen 這樣

        I want to make a Dialog Screen Like WhatsApp Profile Photo Dialog Screen(我想制作一個像 WhatsApp Profile Photo Dialog Screen 這樣的對話屏幕)

      2. <small id='RTeua'></small><noframes id='RTeua'>

          <tfoot id='RTeua'></tfoot>
            <tbody id='RTeua'></tbody>
          <i id='RTeua'><tr id='RTeua'><dt id='RTeua'><q id='RTeua'><span id='RTeua'><b id='RTeua'><form id='RTeua'><ins id='RTeua'></ins><ul id='RTeua'></ul><sub id='RTeua'></sub></form><legend id='RTeua'></legend><bdo id='RTeua'><pre id='RTeua'><center id='RTeua'></center></pre></bdo></b><th id='RTeua'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='RTeua'><tfoot id='RTeua'></tfoot><dl id='RTeua'><fieldset id='RTeua'></fieldset></dl></div>
            • <bdo id='RTeua'></bdo><ul id='RTeua'></ul>

              1. <legend id='RTeua'><style id='RTeua'><dir id='RTeua'><q id='RTeua'></q></dir></style></legend>
                • 本文介紹了我想制作一個像 WhatsApp Profile Photo Dialog Screen 這樣的對話屏幕的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  你好朋友......

                  我目前正在嘗試使用隱式意圖制作一個對話框,我想在其中顯示我的對話框,例如 whatsApp(個人資料照片屏幕),并且在此屏幕中,whatsApp 正在使用名為刪除照片"的額外字段.當我嘗試制作相同類型的屏幕對話框時,我無法添加這個額外的字段(刪除照片").我已經(jīng)完成了所有代碼.它對于對話框中的三個選項(例如(圖庫,照片,相機))工作正常,我無法在 onActivityResult() 中處理所有這些.我正在發(fā)送我已經(jīng)非常努力的所有源代碼,但我無法找到這樣做的解決方案.plz.....朋友們幫我解決這個問題.

                  I am currently trying to make a Dialog using Implicit Intent where i want to show my Dialog like whatsApp(Profile Photo Screen) and in this screen whatsApp are using extra field named as "Remove Photo". When i try to make same type of screen Dialog then i am unable to add this extra field("Remove Photo"). i have done all code. its working fine for three option in Dialog like(Gallery,Photo,Camera) and i am unable to handle these all in onActivityResult() . I am sending my all source code i have tried much hard , but i am not able to find the solution to do so. plz..... friends help me out from this.

                  在這段代碼中,我只是創(chuàng)建了一個名為 openFileChooser() 的方法,我在其中編寫了所有用于創(chuàng)建對話框屏幕的代碼并在 onActivityResult() 中處理此結果

                  In this code i am simply create a method named as openFileChooser() in which i have write all the code for creating Dialog Screen and handle this outcomes in onActivityResult()

                  這是我的代碼

                  ProfilePhotoActivity.java

                  ProfilePhotoActivity.java

                  public class ProfilePhotoActivity extends Activity implements OnClickListener{
                      ImageButton back, editPhoto, selectAction;
                      ImageView imgCamera;
                      private static final int FILECHOOSER_RESULTCODE   = 2888;
                      protected static final int CAMERA_REQUEST = 0;
                      protected static final int GALLERY_PICTURE = 1;
                      private Uri mCapturedImageURI = null;
                      Intent intent;
                  
                      @Override
                      protected void onCreate(Bundle savedInstanceState) {
                          super.onCreate(savedInstanceState);
                          requestWindowFeature(Window.FEATURE_NO_TITLE);
                          getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                                  WindowManager.LayoutParams.FLAG_FULLSCREEN);
                          setContentView(R.layout.activity_profilephoto);
                  
                          back=(ImageButton)findViewById(R.id.btn_back);
                          editPhoto=(ImageButton)findViewById(R.id.ibEditPhoto);
                          selectAction=(ImageButton)findViewById(R.id.ibSelectAction);
                  
                          imgCamera=(ImageView)findViewById(R.id.imvProfilePhoto);
                  
                          editPhoto.setOnClickListener(this);
                          selectAction.setOnClickListener(this);
                          back.setOnClickListener(this);
                      }
                  
                      @Override
                      public void onClick(View v) {
                  
                          switch (v.getId()) {
                          case R.id.btn_back:
                              ProfilePhotoActivity.this.finish();
                              break;
                  
                          case R.id.ibEditPhoto:
                              openFileChooser(null, null);
                          //  startDialog();
                  
                  
                              break;
                          case R.id.ibSelectAction:
                              break;
                          }
                      }
                  
                       public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType){  
                  
                              try{    
                  
                               // Create AndroidExampleFolder at sdcard
                  
                               File imageStorageDir = new File(
                                 Environment.getExternalStoragePublicDirectory(
                                   Environment.DIRECTORY_PICTURES)
                                   , "AndroidExampleFolder");
                  
                               if (!imageStorageDir.exists()) {
                                // Create AndroidExampleFolder at sdcard
                                imageStorageDir.mkdirs();
                               }
                  
                               // Create camera captured image file path and name 
                               File file = new File(
                                 imageStorageDir + File.separator + "IMG_"
                                   + String.valueOf(System.currentTimeMillis()) 
                                   + ".jpg");
                  
                               mCapturedImageURI = Uri.fromFile(file); 
                  
                               // Camera capture image intent
                               final Intent captureIntent = new Intent(
                                 android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
                  
                               captureIntent.putExtra(MediaStore.EXTRA_OUTPUT, mCapturedImageURI);
                  
                               Intent i = new Intent(Intent.ACTION_PICK); 
                              // i.addCategory(Intent.CATEGORY_OPENABLE);
                               i.setType("image/*");
                  
                               // Create file chooser intent
                               Intent chooserIntent = Intent.createChooser(i, "Image Chooser");
                  
                               // Set camera intent to file chooser 
                               chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS
                                 , new Parcelable[] { captureIntent });
                  
                               // On select image call onActivityResult method of activity
                               startActivityForResult(chooserIntent, FILECHOOSER_RESULTCODE);
                  
                              }
                              catch(Exception e){
                               Toast.makeText(getBaseContext(), "Exception:"+e, 
                                 Toast.LENGTH_LONG).show();
                              }
                  
                             }
                       protected void onActivityResult(int requestCode, int resultCode,Intent intent) { 
                  
                            if(requestCode==FILECHOOSER_RESULTCODE)  
                            {  
                                if (requestCode == GALLERY_PICTURE)
                                      {
                                          if (resultCode == RESULT_OK) 
                                          {
                                              if (intent != null) 
                                              {                   
                                                  // our BitmapDrawable for the thumbnail
                                                  BitmapDrawable bmpDrawable = null;
                  
                                                  // try to retrieve the image using the data from the intent
                                                  Cursor cursor = getContentResolver().query(intent.getData(), null, null, null, null);
                  
                                                  if (cursor != null) 
                                                  {
                                                      cursor.moveToFirst();
                  
                                                      int idx = cursor.getColumnIndex(ImageColumns.DATA);
                                                      String fileSrc = cursor.getString(idx);
                                                      Bitmap galleryBitmap = BitmapFactory.decodeFile(fileSrc); // load preview image                                                                         
                                                      galleryBitmap = Bitmap.createScaledBitmap(galleryBitmap, 200, 200, true);
                  
                  
                                                      String filePath = Environment.getExternalStorageDirectory()
                                                      .getAbsolutePath()+"/TimeChat/image/"+System.currentTimeMillis()+".jpg";
                  
                                                      //imgCamera.setRotation(0);
                                                      imgCamera.setImageBitmap(galleryBitmap);
                  //                                  writeToFile(filePath, galleryBitmap);
                                                  } 
                                                  else 
                                                  {
                                                      bmpDrawable = new BitmapDrawable(getResources(), intent.getData().getPath());
                                                      imgCamera.setImageDrawable(bmpDrawable);
                                                  }
                                              } 
                                              else 
                                              {
                                                  Toast.makeText(getApplicationContext(), "Cancelled", Toast.LENGTH_SHORT).show();
                                              }
                                          } 
                                          else if (resultCode == RESULT_CANCELED) 
                                          {
                                              Toast.makeText(getApplicationContext(), "Cancelled", Toast.LENGTH_SHORT).show();
                                          }
                                      } 
                                      else if (requestCode == CAMERA_REQUEST) 
                                      {
                                          if (resultCode == RESULT_OK) 
                                          {
                                              if (intent.hasExtra("data"))
                                              {                   
                                                  // retrieve the bitmap from the intent
                                                  Bitmap cameraBitmap = (Bitmap) intent.getExtras().get("data");
                  
                                                      String filePath = Environment.getExternalStorageDirectory()
                                                  .getAbsolutePath()+"/TimeChat/image/"+System.currentTimeMillis()+".jpg";
                  
                                                  // update the image view with the bitmap
                                                  imgCamera.setImageBitmap(cameraBitmap);
                                              //  writeToFile(filePath, circleBitmap);
                  
                                              } 
                                              else if (intent.getExtras() == null) {
                  
                                                  Toast.makeText(getApplicationContext(), "No extras to retrieve!", Toast.LENGTH_SHORT).show();
                  
                                                  BitmapDrawable thumbnail = new BitmapDrawable(getResources(), intent.getData().getPath());
                  
                                                  // update the image view with the newly created drawable
                                                  imgCamera.setImageDrawable(thumbnail);
                  
                                              }
                  
                                          } 
                                          else if (resultCode == RESULT_CANCELED) {
                                              Toast.makeText(getApplicationContext(), "Cancelled", Toast.LENGTH_SHORT).show();
                                          }
                                      }
                            }
                           }
                  
                  
                      @Override
                      public void onBackPressed() {
                          // TODO Auto-generated method stub
                          super.onBackPressed();
                          ProfilePhotoActivity.this.finish();
                      }
                  
                  }
                  

                  推薦答案

                  這看起來會是個問題:

                   if(requestCode==FILECHOOSER_RESULTCODE)  
                            {  
                                if (requestCode == GALLERY_PICTURE)
                  

                  除非 FILECHOOSER_RESULTCODE 和 GALLERY_PICTURE 是相同的整數(shù),否則語句將永遠不會通過.

                  unless FILECHOOSER_RESULTCODE and GALLERY_PICTURE are the same ints then statement will never pass.

                  這篇關于我想制作一個像 WhatsApp Profile Photo Dialog Screen 這樣的對話屏幕的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Get user#39;s current location using GPS(使用 GPS 獲取用戶的當前位置)
                  IllegalArgumentException thrown by requestLocationUpdate()(requestLocationUpdate() 拋出的 IllegalArgumentException)
                  How reliable is LocationManager#39;s getLastKnownLocation and how often is it updated?(LocationManager 的 getLastKnownLocation 有多可靠,多久更新一次?)
                  How to detect Location Provider ? GPS or Network Provider(如何檢測位置提供者?GPS 或網(wǎng)絡提供商)
                  Get current location during app launch(在應用啟動期間獲取當前位置)
                  locationManager.getLastKnownLocation() return null(locationManager.getLastKnownLocation() 返回 null)

                      <tbody id='zlfI0'></tbody>
                      <bdo id='zlfI0'></bdo><ul id='zlfI0'></ul>
                    • <legend id='zlfI0'><style id='zlfI0'><dir id='zlfI0'><q id='zlfI0'></q></dir></style></legend>

                        <small id='zlfI0'></small><noframes id='zlfI0'>

                        1. <tfoot id='zlfI0'></tfoot>

                        2. <i id='zlfI0'><tr id='zlfI0'><dt id='zlfI0'><q id='zlfI0'><span id='zlfI0'><b id='zlfI0'><form id='zlfI0'><ins id='zlfI0'></ins><ul id='zlfI0'></ul><sub id='zlfI0'></sub></form><legend id='zlfI0'></legend><bdo id='zlfI0'><pre id='zlfI0'><center id='zlfI0'></center></pre></bdo></b><th id='zlfI0'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='zlfI0'><tfoot id='zlfI0'></tfoot><dl id='zlfI0'><fieldset id='zlfI0'></fieldset></dl></div>
                          • 主站蜘蛛池模板: 日本久草视频 | www.狠狠干| 欧美一级在线观看 | 91.com在线观看 | 亚洲综合国产 | 亚洲精品1 | 四虎永久免费地址 | 亚洲乱码一区二区三区在线观看 | 日韩午夜一区二区三区 | 久久av.com | 亚洲福利一区 | 日本在线一区二区三区 | 福利国产| 一区二区免费在线观看 | 国产在线一级片 | 爱高潮www亚洲精品 中文字幕免费视频 | 久久久久国产精品一区二区 | 午夜精品久久久久久久久久久久 | 四虎成人免费电影 | 日本视频中文字幕 | 日韩一区二区三区四区五区六区 | 毛片.com | 日韩免费高清视频 | 国产一区二区观看 | 欧美一区二区三区,视频 | 欧洲色综合 | 精品成人免费一区二区在线播放 | 毛片一级网站 | 久久精品国产一区 | 国产精品亚洲精品日韩已方 | 男女av| 拍真实国产伦偷精品 | 天天操天天干天天透 | 日本三级线观看 视频 | 欧美一级片 | 久久久精品高清 | 国产乱码一区 | 欧美xxxx网站| 中文字幕日韩三级 | 国产 日韩 欧美 在线 | 91精品国产99久久 |