Android Программная установка текста кнопки

Кто-нибудь знает, как программно установить текст кнопки?

дело в том, что я не вызываю это из основного макета (setContentView), я вызываю его в представлении, которое раздувается после асинтаска вот что я пробовал, но это дает исключение нулевого указателя во 2-й строке

Button mButton=(Button)findViewById(R.id.contact);
        mButton.setText("number");

вот мой макет, где я вызываю кнопку

   <Button
       android:id="@+id/contact"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_below="@+id/address"
       android:layout_toLeftOf="@+id/badge"
       android:background="@drawable/ic_btn_call"
       android:textSize="10dp"
       android:textStyle="bold"
       android:textColor="@color/white"/>

здесь мое представление, которое я раздуваю

ClubInfo = LayoutInflater.from(getBaseContext()).inflate(R.layout.clubinfocell,
                null);

        TextView TeamNameText = (TextView) ClubInfo.findViewById(R.id.TeamName);
        TeamNameText.setText(teamName);

        TextView AddressText = (TextView) ClubInfo.findViewById(R.id.address);
        AddressText.setText(address1);



        Button mButton=(Button)ClubInfo.findViewById(R.id.contact);
        mButton.setText(telephone);
12
задан Luke Batley 22 June 2012 в 11:20
поделиться