Created
November 23, 2009 18:28
-
-
Save bastos/241260 to your computer and use it in GitHub Desktop.
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
package org.bastos; | |
import java.util.Random; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import android.widget.TextView; | |
public class OhMyGOd extends Activity { | |
/** Called when the activity is first created. */ | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.main); | |
final TextView helloTextView = | |
(TextView) findViewById(R.id.hello); | |
//final String helloText = helloTextView.getText().toString(); | |
helloTextView.setText(this.getAcronym()); | |
} | |
public String getAcronym(){ | |
String acronymList = this.getString(R.string.acronym_list); | |
String[] acronyms = acronymList.split("\n"); | |
Integer index = new Random().nextInt(acronyms.length-1); | |
return acronyms[index]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment