Just added a new button for my already working layout, but the findViewById function seems to be angry with what I don't understand.
Here is a little layout:
<LinearLayout ... > <ListView android:id="@+id/my_lovely_list" android:layout_width="fill_parent" android:layout_weight="1" /> <Button android:id="@+id/my_lovely_butt" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/exit_b" android:layout_weight="0" android:clickable="true" /> </LinearLayout>
And here is some code:
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); ... list_o = (ListView)findViewById(R.id.my_lovely_list); butt_o = (Button)findViewById(R.id.my_lovely_butt); ... }
So, the big problem is that the ListView is found without any problems, but Button will not be in any way. I already tried to clear Proyect and see all the messages that I found here ... but still not find this problem! Any thoughts?
source share