Created
March 2, 2014 17:16
-
-
Save csdear/9309911 to your computer and use it in GitHub Desktop.
Notifications : Basic Toast!
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
public class NotificationToastActivity extends Activity { | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.main); | |
Button button = (Button) findViewById(R.id.toast_button); | |
button.setOnClickListener(new OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
Toast.makeText(getApplicationContext(), "You're toast!", Toast.LENGTH_LONG).show(); | |
} | |
}); | |
} | |
} | |
========================= | |
Toast.makeText(getApplicationContext(), "You already have this location badge", Toast.LENGTH_SHORT).show(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment