Last active
August 29, 2015 13:58
-
-
Save tagrudev/10115912 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 class arrivi extends Fragment { | |
ListView list; | |
String[] web = { | |
"Google Plus", | |
"Twitter", | |
"Windows", | |
"Bing", | |
"Itunes", | |
"Wordpress", | |
"Drupal" | |
} ; | |
Integer[] imageId = { | |
R.drawable.aereo, | |
R.drawable.aereo, | |
R.drawable.aereo, | |
R.drawable.aereo, | |
R.drawable.aereo, | |
R.drawable.aereo, | |
R.drawable.aereo | |
}; | |
@Override | |
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | |
View ios = inflater.inflate(R.layout.arrivi, container, false); | |
CustomList adapter = new CustomList(this.getActivity(), web, imageId); | |
list=(ListView)ios.findViewById(R.id.listView1); | |
list.setAdapter(adapter); | |
list.setOnItemClickListener(new AdapterView.OnItemClickListener() { | |
@Override | |
public void onItemClick(AdapterView<?> parent, View view, | |
int position, long id) { | |
Toast.makeText(MainActivity.this, "You Clicked at " +web[+ position], Toast.LENGTH_SHORT).show(); | |
} | |
}); | |
return ios; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment