锘??xml version="1.0" encoding="utf-8" standalone="yes"?>在线免费国产,欧美性video,成人影院avhttp://www.aygfsteel.com/yuxh/category/51112.htmlwayzh-cnSun, 18 Mar 2012 16:23:55 GMTSun, 18 Mar 2012 16:23:55 GMT60Andriod webview瀹炵幇鏂囦歡涓婁紶http://www.aygfsteel.com/yuxh/archive/2012/03/12/371715.htmlyuxhyuxhMon, 12 Mar 2012 04:54:00 GMThttp://www.aygfsteel.com/yuxh/archive/2012/03/12/371715.htmlhttp://www.aygfsteel.com/yuxh/comments/371715.htmlhttp://www.aygfsteel.com/yuxh/archive/2012/03/12/371715.html#Feedback0http://www.aygfsteel.com/yuxh/comments/commentRss/371715.htmlhttp://www.aygfsteel.com/yuxh/services/trackbacks/371715.html
Andriod 鍒?.2鐗堟湰涓烘錛寃ebview鏂瑰紡涓嬩嬌鐢?lt;input type="file" />鐐瑰嚮鍚庨兘娌℃湁鍙嶅簲銆傚疄闄呬笂欏跺眰鏄湁闅愬惈鐨勬帴鍙f病瀹炵幇鐨勶紝鍙互鑷繁閲嶅啓榪欎釜鏂規(guī)硶鏉ュ疄鐜般備互phonegap涓轟緥錛?br />
public class App extends DroidGap {
    
private ValueCallback<Uri> mUploadMessage;
    
private final static int FILECHOOSER_RESULTCODE = 1;

    
/** Called when the activity is first created. */
    @Override
    
public void onCreate(Bundle savedInstanceState) {
        
super.onCreate(savedInstanceState);
        
super.init();
        
// WebView wv = new WebView(this);
        
// wv.setWebViewClient(new WebViewClient());
        this.appView.setWebChromeClient(new CordovaChromeClient(App.this) {
            
// For Android 3.0+
            public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType) {
                mUploadMessage 
= uploadMsg;
                Intent i 
= new Intent(Intent.ACTION_GET_CONTENT);
                i.addCategory(Intent.CATEGORY_OPENABLE);
                i.setType(
"image/*");
                App.
this.startActivityForResult(Intent.createChooser(i, "File Chooser"), FILECHOOSER_RESULTCODE);
            }

            
// The undocumented magic method override
            
// Eclipse will swear at you if you try to put @Override here
            public void openFileChooser(ValueCallback<Uri> uploadMsg) {
                mUploadMessage 
= uploadMsg;
                Intent i 
= new Intent(Intent.ACTION_GET_CONTENT);
                i.addCategory(Intent.CATEGORY_OPENABLE);
                i.setType(
"image/*");
                App.
this.startActivityForResult(Intent.createChooser(i, "File Chooser"), App.FILECHOOSER_RESULTCODE);
            }
        });

        
// setContentView(wv);
        super.loadUrl("file:///android_asset/www/login.html");
    }

    @Override
    
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
        
if (requestCode == FILECHOOSER_RESULTCODE) {
            
if (null == mUploadMessage)
                
return;
            Uri result 
= intent == null || resultCode != RESULT_OK ? null : intent.getData();
            mUploadMessage.onReceiveValue(result);
            mUploadMessage 
= null;
        }
    }
}
濡傛灉鐩存帴鐨剋ebview鏂瑰紡錛宔xtends WebChromeClient鍗沖彲銆? 鍙傝冿細(xì)http://stackoverflow.com/questions/5907369/file-upload-in-webview

yuxh 2012-03-12 12:54 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 台东市| 开封县| 洪泽县| 兴海县| 健康| 宣威市| 新蔡县| 高平市| 合水县| 绍兴县| 兰州市| 灵丘县| 青神县| 石屏县| 芷江| 樟树市| 黄石市| 威海市| 哈巴河县| 偏关县| 庐江县| 新密市| 安徽省| 香港 | 鹤庆县| 湖口县| 宁乡县| 肥城市| 金华市| 崇礼县| 黄平县| 漳州市| 库车县| 垦利县| 孝义市| 贵港市| 翁牛特旗| 秦皇岛市| 襄城县| 延安市| 体育|