小编Ali*_*air的帖子

Android意图POST URL?

我有以下代码(简化为简化),它将用户带到指定的URL:

    Button b = (Button) findViewById( R.id.button );
    b.setOnClickListener( new OnClickListener() {
        public void onClick( View v ) {
                Intent i = new Intent( Intent.ACTION_VIEW );
                i.setData( Uri.parse( "http://example.com/myform/?a=b&c=d&e=f" ) );
                if (i.resolveActivity(getPackageManager()) != null) {                    
                            startActivity( i );
                }
        }
    } );
Run Code Online (Sandbox Code Playgroud)

效果很好,但有点难看,因为CGI参数显示在Android网页浏览器的URL栏中(它们是各种丑陋的会话密钥等).有没有办法使用HTTP POST这样做,所以他们被隐藏了?

post android http

5
推荐指数
1
解决办法
4803
查看次数

标签 统计

android ×1

http ×1

post ×1