Supongamos que tengo un simple diseño XML como el siguiente:inflar vs findViewById
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" />
¿Hay diferencias en las siguientes llamadas? y ¿cuál debo usar?
button = (Button) getLayoutInflater().inflate(R.layout.button, null);
y
View v = getLayoutInflater().inflate(R.layout.button, null);
button = (Button) v.findViewById(R.id.button01);
Oops, filtra mi código. aquí: Botón \t xmlns: android = "http://schemas.android.com/apk/res/android" \t android: id = "@ +/Identificación del button01" \t androide: layout_width = "wrap_content" \t android: layout_height = "wrap_content" –