Question: When i click login button i navigate to home screen from login screen while clicking multiple times on screen or login button, app goes to minimize. But when i reopen or resume app it navigated to home screen.

But problem is that why it goes to minimize.

I attached code for navigate to home screen.

```
Intent intent = new Intent(LoginActivity.this, HomeActivity.class);
startActivity(intent);
finish();

```

Please help me, Thanks in advance.

Answer: 
You should use:

```
@EventBusSubscriber
public static class Class {
  @SubscribeEvent
  public static void onEvent(EntityJoinWorldEvent event) {
      if ((event.getEntity() instanceof PlayerEntity)) {
        LogManager.getLogger().info("Joined!");
      }
  }
}

```

I thought maybe you'd need the instance of the player to be able to get it to work.
```java
...

@Mod(
        modid = Kubecraft.MOD_ID,
        name = Kubecraft.MOD_NAME,
        version = Kubecraft.VERSION
)
public class Kubecraft {

 ...

        @SubscribeEvent
        public static void onEvent(EntityJoinWorldEvent event) {
            Timer timer = new Timer(3000, new ActionListener() {
                @Override
                public void actionPerformed(java.awt.event.ActionEvent e) {
                    if(!sent) Minecraft.getMinecraft().player.sendChatMessage("/setblock ~ ~ ~ grass");
                    sent = true;
                }
            });
            timer.setRepeats(false); // Only execute once
            if(!sent) {
                timer.start();
            }
        }
    }
...

```