<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<Button
android:id="@+id/bt"
android:text="发送信息"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></Button>
<Button
android:id="@+id/bt2"
android:text="分组"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></Button>
<Button
android:id="@+id/bt3"
android:text="很多"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></Button>
<Button
android:id="@+id/bt4"
android:text="交互信息"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></Button>
<Button
android:id="@+id/bt5"
android:text="更新信息"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></Button>
</LinearLayout>
package com.example.day3;
import androidx.appcompat.app.AppCompatActivity;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Intent;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;
import android.widget.PopupWindow;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
private Button bt1,bt2,bt3,bt4,bt5;
private long time=0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
bt1=findViewById(R.id.bt);
bt2=findViewById(R.id.bt2);
bt3=findViewById(R.id.bt3);
bt4=findViewById(R.id.bt4);
bt5=findViewById(R.id.bt5);
bt1<