Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.example.moviecatalogue;
- import androidx.appcompat.app.ActionBar;
- import androidx.appcompat.app.AppCompatActivity;
- import android.content.Intent;
- import android.os.Bundle;
- import android.widget.ImageView;
- import android.widget.TextView;
- public class Detail extends AppCompatActivity {
- public static final String EXTRA_MOVIE ="extra_movie" ;
- TextView tvjudul,tvdeskrip;
- ImageView imgphoto;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.detail);
- ActionBar actionBar = getSupportActionBar();
- tvjudul = findViewById(R.id.txt_name);
- tvdeskrip = findViewById(R.id.txt_description);
- imgphoto = findViewById(R.id.img_photo);
- Intent intent = getIntent();
- Movie movie = intent.getParcelableExtra(EXTRA_MOVIE);
- String judul = movie.getName();
- String desc = movie.getDescription();
- Integer image = movie.getPhoto();
- tvjudul.setText(judul);
- tvdeskrip.setText(desc);
- imgphoto.setImageResource( image );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement