java - search a website in android -
i in development of android search particular word in website..for developed code...but not complete...is able help..it me...thank reading
public class mainactivity extends activity { edittext et = new edittext(this); public void onclick(view v){ editable searchtext = et.gettext(); intent intent = new intent(this, com.example.app.mainactivity.class); intent.putextra("searchquery", searchtext); startactivity(intent); } }
try it....
<edittext android:id="@+id/edt_search" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@android:color/transparent" android:ellipsize="end" android:hint="enter text" android:imeoptions="actiongo" android:singleline="true" android:textsize="14sp" /> edittext edt_search; edt_search = (edittext) findviewbyid(r.id.edt_search_book); edt_search.setimeoptions(editorinfo.ime_action_go); edt_search.setoneditoractionlistener(new oneditoractionlistener() { public boolean oneditoraction(textview v, int actionid, keyevent event) { // log.i("keyboard" ,"inside edit text"); if (actionid == editorinfo.ime_action_go) { intent intent = new intent(intent.action_web_search); intent.putextra(searchmanager.query, edt_search.gettext().tostring()); // query contains startactivity(intent); // search string } return false; } });
Comments
Post a Comment