Created
July 15, 2015 01:12
-
-
Save jen6/d468a59ed3b15ea44f40 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | |
final View view = inflater.inflate(R.layout.section_1,container,false); | |
ListView mListView = (ListView) view.findViewById(R.id.mList); | |
BusListGetter get = new BusListGetter(); | |
BusList[] bus_arr = get.Get(1); | |
mAdapter = new ListViewAdapter(getActivity()); | |
mListView.setAdapter(mAdapter); | |
int signal_index = R.drawable.signal0; | |
for(int i = 0; i < bus_arr.length; i++) { | |
mAdapter.addItem(getResources().getDrawable(signal_index+bus_arr[i].Want), getResources().getDrawable(R.drawable.bus1), | |
bus_arr[i].Title, bus_arr[i].Content); | |
} | |
mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { | |
@Override | |
public void onItemClick(AdapterView<?> parent, View v, int position, long id){ | |
ListData mData = mAdapter.mListData.get(position); | |
Intent myIntent = new Intent(Tab1.this.getActivity(), TeamBuildingDetails.class); | |
Tab1.this.startActivity(myIntent); | |
} | |
}); | |
mFloatingButton = (FloatingActionButton) view.findViewById(R.id.mFloatingActionButton); | |
mFloatingButton.attachToListView(mListView); | |
mFloatingButton.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
Intent myIntent = new Intent(Tab1.this.getActivity(), write.class); | |
Tab1.this.startActivity(myIntent); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment