Created
January 28, 2018 12:12
-
-
Save abdurahmanadilovic/f61eed70684d16df3560150e7941a1f6 to your computer and use it in GitHub Desktop.
Java manual map showcase
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void JavaMap() throws Exception{ | |
List<String> listOfLinks = new ArrayList<>(); | |
Context testContext = InstrumentationRegistry.getTargetContext(); | |
listOfLinks.add("www.codingstoic.com"); | |
listOfLinks.add("www.codingblast.com"); | |
listOfLinks.add("www.kotlinlang.org"); | |
listOfLinks.add("www.android.com"); | |
List<TextView> listOfTextViews = new ArrayList<>(); | |
for (String link: listOfLinks){ | |
TextView tmpTextView = new TextView(testContext); | |
tmpTextView.setText(link); | |
listOfTextViews.add(tmpTextView); | |
} | |
ViewGroup rootView = new LinearLayout(testContext); | |
for (TextView textView : listOfTextViews){ | |
rootView.addView(textView); | |
} | |
assertEquals(listOfLinks.get(0), listOfTextViews.get(0).getText().toString()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment