Back to project page fragments.
The source code is released under:
GNU General Public License
If you think the Android project fragments 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 edu.cs4730.frag1demo; //from w ww .ja va 2 s.c o m import android.app.ListFragment; import android.os.Bundle; import android.view.View; import android.widget.ArrayAdapter; import android.widget.ListView; public class titlefrag extends ListFragment { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); ArrayAdapter<String> adapter = new ArrayAdapter<String>(getActivity(), android.R.layout.simple_list_item_1, Shakespeare.TITLES); setListAdapter(adapter); } @Override public void onListItemClick(ListView l, View v, int position, long id) { textFrag frag = (textFrag) getFragmentManager().findFragmentById(R.id.frag_text); if (frag != null && frag.isInLayout()) { frag.setText(Shakespeare.DIALOGUE[position]); } } }