Back to project page Fragment-NetEase.
The source code is released under:
Apache License
If you think the Android project Fragment-NetEase listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package fragment_content; //w w w . jav a 2s. c om import android.app.Fragment; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import com.gracker.tabfragment.R; public class TopBarFragment extends Fragment { TextView mTextView; @Override public void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); } @Override public void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { //super.onCreateView(inflater, container, savedInstanceState); // Inflate the layout for this fragment return inflater.inflate(R.layout.fragment_topbar, container, false); } public void changeContent(int index) { mTextView = (TextView) getActivity().findViewById( R.id.fragment_topbar_topic); switch (index) { case 0: mTextView.setText(R.string.news_top_left_text); break; case 1: mTextView.setText(R.string.topic_top_left_text); break; case 2: mTextView.setText(R.string.picture_top_left_text); break; case 3: mTextView.setText(R.string.follow_top_left_text); break; case 4: mTextView.setText(R.string.vote_top_left_text); break; default: break; } } }