久久久久久久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 正在使用名為刪除照片"的額外字段.當我嘗試制作相同類型的屏幕對話框時,我無法添加這個額外的字段(刪除照片").我已經完成了所有代碼.它對于對話框中的三個選項(例如(圖庫,照片,相機))工作正常,我無法在 onActivityResult() 中處理所有這些.我正在發送我已經非常努力的所有源代碼,但我無法找到這樣做的解決方案.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.

                  在這段代碼中,我只是創建了一個名為 openFileChooser() 的方法,我在其中編寫了所有用于創建對話框屏幕的代碼并在 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 是相同的整數,否則語句將永遠不會通過.

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

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

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

                  相關文檔推薦

                  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 或網絡提供商)
                  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>
                          • 主站蜘蛛池模板: 欧美精品久久久久 | 涩涩视频大全 | 亚洲视频在线免费观看 | 国产精品不卡视频 | 亚洲码欧美码一区二区三区 | 黄色免费在线观看 | 国产91黄色 | 欧美阿v| av黄色在线播放 | 九九九久久国产免费 | 在线观看视频亚洲 | 日韩欧美成人精品 | www精品美女久久久tv | 亚洲国产精品成人无久久精品 | 久久综合狠狠综合久久 | 99精品亚洲国产精品久久不卡 | 亚洲精品国产第一综合99久久 | 不卡的av在线 | 亚洲一区二区三区国产 | 成人一区二区在线 | 羞羞视频免费观看 | 成人免费视频一区二区 | 午夜免费观看网站 | 国产露脸对白88av | 亚洲有码转帖 | 一区二区视频 | www久久| 国产高清一区二区三区 | 蜜桃视频在线观看免费视频网站www | 伊人久久国产 | 日韩一区二区成人 | 欧美午夜一区二区三区免费大片 | 毛片a| 97国产精品 | 亚洲一区视频在线 | 草草影院ccyy | 日韩中文字幕区 | 婷婷开心激情综合五月天 | 欧美涩涩网| 成人黄色电影在线观看 | www.色午夜.com |