Skip to content

Instantly share code, notes, and snippets.

@alfianyusufabdullah
Created February 3, 2017 11:32
Show Gist options
  • Save alfianyusufabdullah/80020883bdc724624d26280c85cfccbc to your computer and use it in GitHub Desktop.
Save alfianyusufabdullah/80020883bdc724624d26280c85cfccbc to your computer and use it in GitHub Desktop.
package com.jonesrandom.tutoriallistview;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;
public class DetailActivity extends AppCompatActivity {
/// VARIABEL 2 TEXTVIEW & 1 IMAGEVIEW
TextView detailNama;
TextView detailPemerintahan;
ImageView detailLogo;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_detail);
/// INISIALISASI TEXTVIEW & IMAGEVIEW
detailNama = (TextView) findViewById(R.id.detail_nama);
detailPemerintahan = (TextView) findViewById(R.id.detail_pemerintahan);
detailLogo = (ImageView) findViewById(R.id.detail_logo);
/// MENGAMBIL DATA YANG DI KIRIM
String nama = getIntent().getStringExtra("NAMA");
String pemerintah = getIntent().getStringExtra("PEMERINTAH");
int Logo = getIntent().getIntExtra("LOGO", 0);
/// SET DATA
detailNama.setText(nama);
detailPemerintahan.setText(pemerintah);
detailLogo.setImageResource(Logo);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment