Created
October 12, 2023 20:23
-
-
Save topherPedersen/637042c0e41f6e0195374cd16f57de58 to your computer and use it in GitHub Desktop.
Display a Toast Message on Android (using Java)
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 com.example.toastapp; | |
import androidx.appcompat.app.AppCompatActivity; | |
import android.os.Bundle; | |
import android.widget.Toast; | |
public class MainActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
Toast.makeText(getApplicationContext(), "foo", Toast.LENGTH_LONG); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment