Guest User

Untitled

a guest
Apr 20th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. package app.little.busters;
  2.  
  3. import android.app.Activity;
  4. import android.content.Intent;
  5. import android.os.Bundle;
  6. import android.view.View;
  7. import android.widget.AdapterView;
  8. import android.widget.AdapterView.OnItemClickListener;
  9. import android.widget.Button;
  10. import android.widget.GridView;
  11. import android.widget.Toast;
  12.  
  13. public class Art extends Activity {
  14.  
  15.  
  16. /** Called when the activity is first created. */
  17. @Override
  18. public void onCreate(Bundle savedInstanceState) {
  19. super.onCreate(savedInstanceState);
  20. setContentView(R.layout.art);
  21.  
  22. GridView artgrid = (GridView) findViewById(R.id.artgrid);
  23. artgrid.setAdapter(new ImageAdapter(this));
  24.  
  25. artgrid.setOnItemClickListener(new OnItemClickListener() {
  26. public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
  27. Toast.makeText(Art.this, "" + position, Toast.LENGTH_SHORT).show();
  28. }
  29. });
  30. }
  31. }
Add Comment
Please, Sign In to add comment