Android Open Source - lists Active_fraglist






From Project

Back to project page lists.

License

The source code is released under:

GNU General Public License

If you think the Android project lists listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package edu.cs4730.ListDemo;
//w w w  .  j  a v  a 2 s . co  m
import java.util.ArrayList;
import java.util.List;

import android.support.v4.app.ListFragment;
import android.content.Context;
import android.os.Bundle;
import android.widget.ArrayAdapter;



public class Active_fraglist extends ListFragment {
    String TAG = "Active_fraglist";
    Context myContext;
  
    
    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
      super.onActivityCreated(savedInstanceState);
      
    // Create an array of Strings, that will be put to our ListActivity
    ArrayAdapter<Model> adapter = new InteractiveArrayAdapter(getActivity(),  getModel());
    setListAdapter(adapter);
  }
  private List<Model> getModel() {
    List<Model> list = new ArrayList<Model>();
    list.add(new Model("Linux"));
    list.add(new Model("Windows7"));
    list.add(new Model("Suse"));
    list.add(new Model("Eclipse"));
    list.add(new Model("Ubuntu"));
    list.add(new Model("Solaris"));
    list.add(new Model("Android"));
    list.add(new Model("iPhone"));
    // Initially select one of the items
    list.get(1).setSelected(true);
    return list;
  }
  //Note no click listener, because it does not get called even when an list item is clicked.
}




Java Source Code List

edu.cs4730.ListDemo.Active_fraglist.java
edu.cs4730.ListDemo.Active_fraglist.java
edu.cs4730.ListDemo.InteractiveArrayAdapter.java
edu.cs4730.ListDemo.InteractiveArrayAdapter.java
edu.cs4730.ListDemo.MainActivity.java
edu.cs4730.ListDemo.MainActivity.java
edu.cs4730.ListDemo.Model.java
edu.cs4730.ListDemo.Model.java
edu.cs4730.ListDemo.Phone_frag.java
edu.cs4730.ListDemo.Phone_frag.java
edu.cs4730.ListDemo.PhonebookAdapter.java
edu.cs4730.ListDemo.PhonebookAdapter.java
edu.cs4730.ListDemo.Phonebook.java
edu.cs4730.ListDemo.Phonebook.java
edu.cs4730.ListDemo.Simple2_fraglist.java
edu.cs4730.ListDemo.Simple2_fraglist.java
edu.cs4730.ListDemo.Simple3_frag.java
edu.cs4730.ListDemo.Simple3_frag.java
edu.cs4730.ListDemo.Simple_fraglist.java
edu.cs4730.ListDemo.Simple_fraglist.java
edu.cs4730.esplistviewdemo.ExpandableListAdapter.java
edu.cs4730.esplistviewdemo.ExpandableListAdapter.java
edu.cs4730.esplistviewdemo.MainActivity.java
edu.cs4730.esplistviewdemo.MainActivity.java
edu.cs4730.esplistviewdemo.elvDemo1_Fragment.java
edu.cs4730.esplistviewdemo.elvDemo1_Fragment.java
edu.cs4730.esplistviewdemo.elvDemo2_Fragment.java
edu.cs4730.esplistviewdemo.elvDemo2_Fragment.java