This series of IoT App development notes are the learning notes of station B video tutorials, video address:
- Day1 How does Android project code work
- Day2 Common controls and interface layout design (part 1)
- Day3 Common controls and interface layout design (part 2)
- Day4 Import of MQTT Jar package and debugging of Internet of Things
- Day5 APP practical control of Internet of Things ESP8266
- 【7 days Java0 basic Crash Android development 】
- [7-day Java0 Basic Rapid Android Development] Day7 achievement Demonstration
1. Toast
Toast is a message prompt mechanism provided in Android. It will pop up a message and disappear after a period of time. It is very convenient.
2. Example
Add the following code to the active file:
Button login_button = (Button)findViewById(R.id.button_login);
login_button.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view) {
Toast.makeText(LoginActivity.this."Login successful",Toast.LENGTH_SHORT).show(); }});Copy the code
3. Operation effect
Welcome to subscribe to my wechat official account: “McUlover666”.