Back to project page mint.
The source code is released under:
GNU General Public License
If you think the Android project mint 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 com.slidingmenu.example.fragments; /*from ww w.j a v a2 s .c om*/ import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.ListFragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.ListView; import com.slidingmenu.example.R; public class BirdMenuFragment extends ListFragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return inflater.inflate(R.layout.list, null); } @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); String[] birds = getResources().getStringArray(R.array.birds); ArrayAdapter<String> colorAdapter = new ArrayAdapter<String>(getActivity(), android.R.layout.simple_list_item_1, android.R.id.text1, birds); setListAdapter(colorAdapter); } @Override public void onListItemClick(ListView lv, View v, int position, long id) { Fragment newContent = new BirdGridFragment(position); if (newContent != null) switchFragment(newContent); } // the meat of switching the above fragment private void switchFragment(Fragment fragment) { if (getActivity() == null) return; if (getActivity() instanceof ResponsiveUIActivity) { ResponsiveUIActivity ra = (ResponsiveUIActivity) getActivity(); ra.switchContent(fragment); } } }