我需要将 3 个下拉值从我的应用程序传递到网站链接http://www.way2franchise.com/
说:广告和媒体,选择投资,选择状态。是我的 3 个价值观。
我需要传递给搜索过滤器链接:
http ://www.way2franchise.com/search/filter_franchise 。
PS:由于stackoverflow的限制,我不能发布超过2个链接。
在讨论中有两个链接:
1.网站链接
2.搜索过滤器链接。
public class DatafetchingActivity extends Activity {
TextView result;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
result = (TextView) findViewById(R.id.result);
BufferedReader bufferedReader = null;
HttpClient httpClient = new DefaultHttpClient();
HttpPost request = new HttpPost("http://www.way2franchise.com/search/filter_franchise");
List<NameValuePair> postParameters = new ArrayList<NameValuePair>();
postParameters.add(new BasicNameValuePair("p", "advertisement_and_media"));
postParameters.add(new BasicNameValuePair("q", "Select Industry"));
postParameters.add(new BasicNameValuePair("r", "Select Industry"));
try {
UrlEncodedFormEntity entity = new UrlEncodedFormEntity(
postParameters);
request.setEntity(entity);
HttpResponse response = httpClient.execute(request);
bufferedReader = new BufferedReader(new InputStreamReader(response
.getEntity().getContent()));
StringBuffer stringBuffer = new StringBuffer("");
String line = "";
String LineSeparator = System.getProperty("line.separator");
while ((line = bufferedReader.readLine()) != null) {
stringBuffer.append(line + LineSeparator);
}
bufferedReader.close();
result.setText(stringBuffer.toString());
Toast.makeText(DatafetchingActivity.this, "Finished",
Toast.LENGTH_LONG).show();
} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Toast.makeText(DatafetchingActivity.this, e.toString(),
Toast.LENGTH_LONG).show();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Toast.makeText(DatafetchingActivity.this, e.toString(),
Toast.LENGTH_LONG).show();
} finally {
if (bufferedReader != null) {
try {
bufferedReader.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
现在,这个输出给出了搜索过滤器的整个结果。它的输出与我复制并粘贴搜索过滤器链接的输出相同。
但这不是我想要的。
我需要的是,如果我打开链接(不是搜索过滤器链接),并选择选项广告和媒体,选择投资,选择状态。我应该只得到基于传递的选项值的结果。