2つのフラグメントがあるという点で、タブ付きアクティビティがあります。 1つのフラグメントにいくつかのTextViewがあります。しかし、私はこれらのtextviewsのテキストを更新できません。私は多くの方法を試しました。これがコードです。タブ付きアクティビティのフラグメント内のTextViewのテキストを更新する
public static class Holder extends Fragment{
private static final String ARG_SECTION_NUMBER1 = "section_number";
public Holder(){
}
TextView Name, Age, Medicine, Doctor, CareTaker;
public static Holder newInstance(int sectionNumber){
Holder fragment1 = new Holder();
Bundle args1 = new Bundle();
args1.putInt(ARG_SECTION_NUMBER1,sectionNumber);
fragment1.setArguments(args1);
return fragment1;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.profile,container,false);
TextView Name = (TextView) rootView.findViewById(R.id.fName);
Name.setText("No Name");
return rootView;
}
私は既にこれらのTextViewにXMLからのいくつかの事前定義済みの値を与えています。
使用して 'その後、アンドロイドに新しい –
イムを設定しなければならないよう あなたのケースではそれは、あなたは手の込んだしてくださいすることができますか? –