Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. import android.support.v7.app.AppCompatActivity;
  2. import android.os.Bundle;
  3. import android.widget.ListView;
  4.  
  5. import java.util.ArrayList;
  6.  
  7. public class MainActivity extends AppCompatActivity {
  8.  
  9. ListView liste;
  10. final ArrayList<Padisah> padisahlar = new ArrayList<Padisah>();
  11.  
  12. @Override
  13. protected void onCreate(Bundle savedInstanceState) {
  14. super.onCreate(savedInstanceState);
  15. setContentView(R.layout.activity_main);
  16.  
  17. liste = (ListView) findViewById(R.id.main_activity_listview_padisahlar);
  18.  
  19. padisahlar.add(new Padisah("I. Osman", "27 yıl", R.mipmap.ic_launcher));
  20. padisahlar.add(new Padisah("I. Orhan", "35 yıl", R.mipmap.ic_launcher));
  21. padisahlar.add(new Padisah("I. Murad", "29 yıl", R.mipmap.ic_launcher));
  22.  
  23.  
  24. PadisahAdapter padisahAdapter = new PadisahAdapter(this, padisahlar);
  25. if (liste != null) {
  26. liste.setAdapter(padisahAdapter);
  27. }
  28. }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement