Skip to content

Instantly share code, notes, and snippets.

@csdear
Created March 2, 2014 17:16
Show Gist options
  • Save csdear/9309911 to your computer and use it in GitHub Desktop.
Save csdear/9309911 to your computer and use it in GitHub Desktop.
Notifications : Basic Toast!
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