Предположим, что у меня есть простой макет xml, например:
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" />
Существуют ли различия в следующих вызовах? и какой из них я должен использовать?
button = (Button) getLayoutInflater().inflate(R.layout.button, null);
и
View v = getLayoutInflater().inflate(R.layout.button, null);
button = (Button) v.findViewById(R.id.button01);