ben gibi basit bir düzen xml varsayalım aşağıdaki:findViewById vs şişirmek
button.xml:
<Button
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/button01"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
aşağıdaki aramalar herhangi bir fark var mıdır? ve hangisini kullanmalıyım?
button = (Button) getLayoutInflater().inflate(R.layout.button, null);
ve
View v = getLayoutInflater().inflate(R.layout.button, null);
button = (Button) v.findViewById(R.id.button01);
Hatalar, kodumu filtreler. Burada: Düğme \t xmlns: android = "http://schemas.android.com/apk/res/android" \t android: id = "@ + id/Button01" \t android: layout_width = "wrap_content" \t android: layout_height = "wrap_content" –