0
I don’t know why , but the items don’t click.
My layout:
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical">
<ImageView
android:id="@+id/imageView1"
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_gravity="center"
android:src="@drawable/manager"
android:background="#9b1136">
</ImageView>
<ListView
android:layout_marginTop="10dp"
android:id="@+id/lista"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
Activity:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ActionBar bar = getActionBar();
bar.hide();
listView = (ListView) findViewById(R.id.lista);
listView.setOnItemClickListener(this);
}
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
// TODO Auto-generated method stub
Toast.makeText(DiretorioView.this, "teste", 1000).show();
}
Items
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:padding="5sp">
<Button
android:id="@+id/imageview"
android:layout_marginLeft="20dp"
android:layout_width="40dp"
android:layout_height="40dp"
android:drawableTop="@drawable/lixo"
android:text="Button" />
<TextView
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textSize="20dp"
android:layout_marginLeft="14sp"
android:textStyle="bold"
android:textColor="#FFFFFF"
android:gravity="center_vertical"/>
</LinearLayout>
</LinearLayout>
Debugged to see if you pass the method
onItemClick
?– rsicarelli
not enough there, I played a log there and nothing
– War Lock
War edition was fine, that’s how I wanted to put?
– Jorge B.
It’s nice to meet you
– War Lock