Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as Plain Text by Listfragment ( 13 years ago )
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
SampleAdapter adapter = new SampleAdapter(getActivity());
String[] names=new String[]{"Title1", "Title2", "Title3", "Title4", "Title5"};
/*Array of Images*/
final int[] image = new int[] { R.drawable.skop4, R.drawable.skop1, R.drawable.skop2, R.drawable.skop5, R.drawable.skop3};
for (int i = 0; i < 5; i++) {
adapter.add(new SampleItem(names[i], image[i]));
switch(image[i]){
case R.drawable.skop4:
getListView().setOnItemClickListener(new OnItemClickListener(){
public void onItemClick(AdapterView<?> parent, View view, int pos, long id) {
{
Intent myIntent = new Intent(getActivity().getBaseContext(), SkopMain.class);
startActivity(myIntent);
}
}
});
break;
case R.drawable.skop1:
getListView().setOnItemClickListener(new OnItemClickListener(){
public void onItemClick(AdapterView<?> parent, View view, int pos, long id) {
{
Intent myIntent = new Intent(getActivity().getBaseContext(), Help.class);
startActivity(myIntent);
}
}
});
break;
}
}
setListAdapter(adapter);
}
Revise this Paste