Basically, I am developing an online library management system. I have successfully displayed the whole database as a listView using PHP, JSON and Async Task. Now I need to search that listView and and display the selected item's detail in a new Activity.
1 Answer
You can try creating your new activity with a WebView that opens your PHP url with a query string dictating your search. This would be a start.
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.webview);
Intent intent = getIntent();
String stringPassed = intent.getExtras().getString("searchParam");
webView = (WebView) findViewById(R.id.webView1);
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl("http://www.yoursite.com/search/?string="+stringPassed);
}
Your listView will have to pass strings to your webView activity in order to dynamically generate your query string, which is subsequently used to generate your search parameters.
1 Comment
Shuvo Shuvo
anyone can send this project please, the link is google webview, but i need that come from webserver.
whereand some appropriate parameters for your http call? if you've gotten this far, it's just a few extra steps to actually FILTER the whole database.