Task 12:- Push NoTificaTioN WiTh fcm
CODING:-MYPROFILEACTIVITY.java
package com.example.smcreation;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import androidx.activity.EdgeToEdge;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.messaging.FirebaseMessaging;
public class MyProfileActivity extends AppCompatActivity {
 TextView tvInfo;
  TextView tvToken;
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_my_profile);
    tvInfo =findViewById(R.id.tvInfo);
    tvToken = findViewById(R.id.tvtoken);
    setTitle("My Profile");
        FirebaseMessaging.getInstance().getToken()
             .addOnCompleteListener(new OnCompleteListener<String>() {
                @Override
                public void onComplete(@NonNull Task<String> task) {
                  if (!task.isSuccessful()) {
                      return;
                  }
                      // Get new FCM registration token
                      String token = task.getResult();
                      tvToken.setText(token);
                      Toast.makeText(MyProfileActivity.this, token, Toast.LENGTH_SHORT).show();
                  }
              });
        tvInfo.setOnClickListener(v -> {
           Intent i = new Intent(MyProfileActivity.this,InfoActivity.class);
           startActivity(i);
              Toast.makeText(MyProfileActivity.this,"Info Activity",Toast.LENGTH_SHORT).show();
        });
        Toast.makeText(MyProfileActivity.this, "My Profile", Toast.LENGTH_SHORT).show();
    }
    @Override
    public void onBackPressed() {
      super.onBackPressed();
      Intent intent = new Intent(MyProfileActivity.this, HomeActivity.class);
      startActivity(intent);