Hi
i defined a button at the bottom in the xml file....and i made (listview)
invisible in the xml file....in java code i give list view
implementation....here when i click on the button that list view has to
appear ..
Thaks in advance
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:id="@+id/LinearLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
<ListView android:id="@+id/ListView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/rl1"
android:background="#bebebe"
android:visibility="invisible"
/>
<Button android:text="projects " android:id="@+id/t1"
android:layout_height="wrap_content"
android:layout_width="wrap_content"></Button>
</RelativeLayout>
Public class ListView extends Activity{
private ListView lv1;
private String
lv_arr1[]={"Android","iPhone","BlackBerry","AndroidPeople"};
public void onCreate(Bundle icicle)
{
super.onCreate(icicle);
setContentView(R.layout.main);
lv1=(ListView)findViewById(R.id.ListView01);
lv1.setAdapter(new
ArrayAdapter<String>(this,android.R.layout.simple_list_item_1 , lv_arr1));
Button btn=(Button)findViewById(R.id.t1);
btn.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
if (((Button) v).isClickable()) {
ListView btn=(ListView)findViewById(R.id.ListView01);
ListView01.setVisibility(View.VISIBLE);
}
}
}
});
}}
--
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