Advertisement
Pit_Anonim

Untitled

Apr 4th, 2019
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.53 KB | None | 0 0
  1. ListView menu = findViewById(R.id.listView);
  2.  
  3.         ArrayList <HashMap<String,String>> data = new ArrayList<>();
  4.         HashMap <String, String> text = new HashMap<>();
  5.  
  6.         text.put("Header", "Theory");
  7.         text.put("Text", "You need to learn it");
  8.  
  9.         data.add(text);
  10.  
  11.         menu.setAdapter(new SimpleAdapter(this,
  12.                 data,
  13.                 android.R.layout.simple_list_item_2,
  14.                 new String[]{"Header", "Text"},
  15.                 new int[]{android.R.id.text1, android.R.id.text2}));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement