Advertisement
Guest User

Detail

a guest
Aug 24th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. package com.example.moviecatalogue;
  2.  
  3. import androidx.appcompat.app.ActionBar;
  4. import androidx.appcompat.app.AppCompatActivity;
  5.  
  6. import android.content.Intent;
  7. import android.os.Bundle;
  8. import android.widget.ImageView;
  9. import android.widget.TextView;
  10.  
  11.  
  12. public class Detail extends AppCompatActivity {
  13. public static final String EXTRA_MOVIE ="extra_movie" ;
  14. TextView tvjudul,tvdeskrip;
  15. ImageView imgphoto;
  16. @Override
  17.  
  18. protected void onCreate(Bundle savedInstanceState) {
  19. super.onCreate(savedInstanceState);
  20. setContentView(R.layout.detail);
  21.  
  22. ActionBar actionBar = getSupportActionBar();
  23.  
  24. tvjudul = findViewById(R.id.txt_name);
  25. tvdeskrip = findViewById(R.id.txt_description);
  26. imgphoto = findViewById(R.id.img_photo);
  27.  
  28.  
  29. Intent intent = getIntent();
  30. Movie movie = intent.getParcelableExtra(EXTRA_MOVIE);
  31.  
  32. String judul = movie.getName();
  33. String desc = movie.getDescription();
  34. Integer image = movie.getPhoto();
  35.  
  36. tvjudul.setText(judul);
  37. tvdeskrip.setText(desc);
  38. imgphoto.setImageResource( image );
  39.  
  40. }
  41.  
  42.  
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement