1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final Button button1 = (Button) findViewById(R.id.button1) ;
final EditText editText1 = (EditText) findViewById(R.id.editText1) ;
button1.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
String recherche = editText1.getText().toString() ;
Intent webSearchIntent = new Intent(Intent.ACTION_WEB_SEARCH) ;
webSearchIntent.putExtra(SearchManager.QUERY, recherche);
startActivity(webSearchIntent);
}
});
} |
Partager