folder Tahribat.com Forumları
linefolder Mobil Programlama
linefolder Android: Webview İçinde File İnput.



Android: Webview İçinde File İnput.

  1. KısayolKısayol reportŞikayet pmÖzel Mesaj
    EnableTurk
    EnableTurk's avatar
    Kayıt Tarihi: 29/Eylül/2007
    Erkek

    Aşağıdaki kodlarla bazı sürümleri çalıştırdım, ancak güncel android sürümlerinde webview içindeki gözat butonları çalışmıyor nasıl yapabiliriz ? 

     

    web.setWebChromeClient(new WebChromeClient()
            {

     


                //The undocumented magic method override
                //Eclipse will swear at you if you try to put @Override here
                // For Android 3.0+
                public void openFileChooser(ValueCallback<Uri> uploadMsg) {

                    mUploadMessage = uploadMsg;
                    Intent i = new Intent(Intent.ACTION_GET_CONTENT);
                    i.addCategory(Intent.CATEGORY_OPENABLE);
                    i.setType("image/*");
                    MainActivity.this.startActivityForResult(Intent.createChooser(i,"File Chooser"), FILECHOOSER_RESULTCODE);

                }

                // For Android 3.0+
                public void openFileChooser( ValueCallback uploadMsg, String acceptType ) {
                    mUploadMessage = uploadMsg;
                    Intent i = new Intent(Intent.ACTION_GET_CONTENT);
                    i.addCategory(Intent.CATEGORY_OPENABLE);
                    i.setType("*/*");
                    MainActivity.this.startActivityForResult(
                            Intent.createChooser(i, "File Browser"),
                            FILECHOOSER_RESULTCODE);
                }

                //For Android 4.1
                public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType, String capture){
                    mUploadMessage = uploadMsg;
                    Intent i = new Intent(Intent.ACTION_GET_CONTENT);
                    i.addCategory(Intent.CATEGORY_OPENABLE);
                    i.setType("image/*");
                    MainActivity.this.startActivityForResult( Intent.createChooser( i, "File Chooser" ), MainActivity.FILECHOOSER_RESULTCODE );

                }

     

     


            });


            setContentView(web);


        }


    yolun açık ve aydınlık olsun ferdi baba.
Toplam Hit: 905 Toplam Mesaj: 1