Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. star = (ImageView) rootView.findViewById(R.id.heart);
  2. star.setOnClickListener(new OnClickListener() {
  3. @Override
  4. public void onClick(View v) {
  5. Toast.makeText(getActivity(),"the star was clicked",
  6. Toast.LENGTH_LONG).show();
  7. }
  8. });
  9.  
  10. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  11. android:layout_width="match_parent"
  12. android:layout_height="match_parent"
  13. android:orientation="vertical">
  14.  
  15. <ImageView
  16. android:id="@+id/lesson_video"
  17. android:layout_width="fill_parent"
  18. android:layout_height="fill_parent"
  19. android:contentDescription="Video"
  20. android:scaleType="centerCrop"
  21. />
  22.  
  23. </LinearLayout>
  24.  
  25.  
  26. public View onCreateView(LayoutInflater inflater, ViewGroup container,
  27. Bundle savedInstanceState) {
  28.  
  29. View v = inflater.inflate(R.layout.lesson_video_fragment, container, false);
  30.  
  31. videoImage = (ImageView)v.findViewById(R.id.lesson_video);
  32.  
  33. videoImage.setOnClickListener(new OnClickListener() {
  34.  
  35. @Override
  36. public void onClick(View v) {
  37.  
  38. //do your thing
  39. }
  40. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement