Android autocompletetextview
<p>Iam desigining an translation application in android where it will translate from german to english basing on the sqlite database.but my intention is to make for both german - english and english - german.but once the data is populated into the autocomplete textview(with german words) then i am unable to load the other data(english)words.
Please help me.</p>

<pre><code>public class MainActivity extends Activity {

   AutoCompleteTextView et1;
   Button bt1,bt2,swap;
   String fi;
   TextView tv1;
   MyDatabase md;
   int counter =2;

   String []list4 = null;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        swap = (Button)findViewById(R.id.swap);
        et1 = (AutoCompleteTextView)findViewById(R.id.editText1);
        tv1 = (TextView)findViewById(R.id.tm);

        swap.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View arg0) {
                // TODO Auto-generated method stub
                counter++;
                Log.i("value s",""+counter);

            }
        });
        if(counter%2 == 0)
        {
            et1.setHint("german");
        md = new MyDatabase(this);
        list4 = md.getListgerman();
        ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this, R.layout.yoho,list4);         
        et1.setAdapter(adapter);

        }
        else
        {
            et1.setHint("english");
md = new MyDatabase(this);
list4 = md.getListenglish();
        ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this, R.layout.yoho,list4);         
        et1.setAdapter(adapter);

        }
        bt1 = (Button)findViewById(R.id.button1);
        bt2 = (Button)findViewById(R.id.exit);
        bt1.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
                String eod = et1.getText().toString();
                if(eod.equals(""))
                {
                    tv1.setText("");
                    Toast.makeText(getApplicationContext(), " Please Enter Any Word", Toast.LENGTH_LONG).show();
                }
                else
                {
                //String et1s = et1.getText().append("%").toString();
                    String et1s = et1.getText().toString();

                String y = md.getData(et1s);
                if(y!=null)
                {
                    //Toast.makeText(getApplicationContext(), "The Translated word is: "+y, Toast.LENGTH_LONG).show();
                    tv1.setText("The Translated word is: "+y);
                }
                else
                {
                    tv1.setText("");
                    Toast.makeText(getApplicationContext(), "No Records Found", Toast.LENGTH_LONG).show();
                }
            }
            }
        });

        bt2.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View arg0) {
                // TODO Auto-generated method stub
                finish();
                System.exit(0);

            }
        });


    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

}
</code></pre>
