ll=(LinearLayout)findViewById(R.id.listView);
linflater = (LayoutInflater)
getSystemService(Context.LAYOUT_INFLATER_SERVICE);
search_interest =(EditText)findViewById(R.id.search_interest);
EditText search_location
=(EditText)findViewById(R.id.search_interest);
names.add("Linux");
names.add("Windows7");
names.add("Eclipse");
names.add("Suse");
names.add("Ubuntu");
names.add("Solaris");
names.add("Android");
names.add("iPhone");
currentView = linflater.inflate(R.layout.listview, null);
list1 =(ListView)currentView.findViewById(R.id.list);
// list1.setAdapter(arrayAdapter);
// list1.setAdapter(new ArrayAdapter<String>(SearchClass.this,
android.R.layout.simple_list_item_1, names));
list1.setAdapter(new ListItemsInterest(SearchClass.this,names));
previousView = linflater.inflate(R.layout.listview, null);
list2 =(ListView)previousView.findViewById(R.id.list);
String[] namesLOCATIOn = new String[] { "LOCATION ", "llll",
"Eclipse", "Suse",
"cccccccccc", "cccccccccccc", "cccccccccccc", "iPhone"};
//list2.setAdapter(new ArrayAdapter<String>(SearchClass.this,
android.R.layout.simple_list_item_1, namesLOCATIOn));
list2.setAdapter(new ListItemsLocation(SearchClass.this,namesLOCATIOn));
search_interest.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if(hasFocus)
{
ll.removeView(currentView);
ll.removeView(previousView);
ll.addView(currentView);
}
else{
ll.removeView(previousView);
ll.removeView(currentView);
ll.addView(previousView);
}
}
});
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en