Back to project page Crescendo.
The source code is released under:
GNU General Public License
If you think the Android project Crescendo listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.crescendo.crescendo; /* w w w.jav a 2 s . c om*/ import android.app.Activity; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.View; import android.view.inputmethod.InputMethodManager; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.ListView; public class RhymeDictionary extends Activity{ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.add_rhy); Button button = (Button) findViewById(R.id.check); final EditText edit= (EditText) findViewById(R.id.enter_rhyme); final RhymeDictionary main= this; button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { RhymeGetter rhy= new RhymeGetter(edit.getText().toString(), main); rhy.execute((Void)null); InputMethodManager inputManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); inputManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); } }); } public void setListView(String[] x){ ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, x); final ListView listView = (ListView) findViewById(R.id.Rhy_listview); listView.setAdapter(adapter); listView.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> myAdapter, View myView, int myItemInt, long mylng) { String selectedFromList =(String) (listView.getItemAtPosition(myItemInt)); Log.d("Rhyme", selectedFromList); finish(selectedFromList); } }); } public void finish(String x){ Intent resultIntent = new Intent(); resultIntent.putExtra("Rhyme", x); // TODO Add extras or a data URI to this intent as appropriate. setResult(Activity.RESULT_OK, resultIntent); finish(); } }