Advertisement
Guest User

Paste underneath setContentView(R.id.activity_quotebook)

a guest
Jan 25th, 2015
11,299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.55 KB | None | 0 0
  1.     RelativeLayout touch = (RelativeLayout) findViewById(R.id.touch);
  2.         final TextView quoteText = (TextView) findViewById(R.id.quote);
  3.         final TextView personText = (TextView) findViewById(R.id.person);
  4.  
  5.         final ArrayList<Quote> quoteList = new ArrayList<Quote>();
  6.  
  7.         Quote quote4 = new Quote("You're more of a fun vampire. You don't suck blood, you just suck.", "Troy Barnes");
  8.         quoteList.add(quote4);
  9.  
  10.         Quote quote1 = new Quote("Cool Beans", "Rod Kimble");
  11.         quoteList.add(quote1);
  12.  
  13.         Quote quote2 = new Quote("How can mirrors be real if our eyes aren't real", "Jaden Smith");
  14.         quoteList.add(quote2);
  15.  
  16.         Quote quote3 = new Quote("That's like me blaming owls for how bad I suck at analogies.", "Britta Perry");
  17.         quoteList.add(quote3);
  18.  
  19.         Quote quote5 = new Quote("I was gonna be the first person in my family to graduate from community college. Everyone else graduated from normal college", "Troy Barnes");
  20.         quoteList.add(quote5);
  21.  
  22.         //Add more quotes here
  23.  
  24.  
  25.         touch.setOnClickListener(new View.OnClickListener() {
  26.             @Override
  27.             public void onClick(View view) {
  28.  
  29.                 if (count < quoteList.size()) {
  30.  
  31.                     Quote q = quoteList.get(count);
  32.  
  33.                     quoteText.setText(q.getQuote());
  34.  
  35.                     personText.setText(q.getPerson());
  36.  
  37.                     count = count + 1;
  38.  
  39.  
  40.                 } else{
  41.  
  42.                     count = 0;
  43.  
  44.                 }
  45.  
  46.  
  47.  
  48.  
  49.             }
  50.         });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement