Execute Intellij Idea action when Editor window looses focus

266

Enable "Perform hot reload on save"

enter image description here

Share:
266
vovahost
Author by

vovahost

If you ever need to edit a SQLite database on Android then use the app I built: SqlitePrime. You can use the built-in SQL Editor, view and edit fields, create Tables, view DDL for Tables, Views, Indices, Triggers. It also has support for editing the Blob data type. You can also edit app's databases (Root needed) https://forum.xda-developers.com/android/apps-games/app-sqliteprime-database-manager-root-t3684598 Apparently it was removed from Google Play Store because it uses the Play services and requires a Privacy policy. The app can be downloaded from here https://sqlite-prime.en.aptoide.com/ until I find time to make it GDPR compliant. TODO: Migrate Sqlite Prime app entirely to Kotlin with MVVM and Open source it (I'm planning to do this when I find a bit more free time).

Updated on December 09, 2022

Comments

  • vovahost
    vovahost over 1 year

    Is there a way to run an action in Intellij Idea when I switch to the Emulator (Intellij Idea Editor looses focus).

    What I want to archive: when I switch to Android Emulator I want to see the code changes without pressing the Keyboard shortcut each time: Intellij Idea action screenshot

    In case this is not possible, is there a way to listen to Editor window focus changed event to write a small plugin ?

    These are my current IDE settings: enter image description here enter image description here

    Output of Flutter doctor:

    flutter doctor -v
    [√] Flutter (Channel dev, v1.2.2, on Microsoft Windows [Version 10.0.17134.590], locale en-US)
        • Flutter version 1.2.2 at C:\dev\flutter\sdks\flutter-sdk
        • Framework revision 007a415c2a (3 days ago), 2019-02-21 20:22:47 -0800
        • Engine revision f1f19bba8f
        • Dart version 2.2.0 (build 2.2.0-dev.2.1 c92d5ca288)
    
    [√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
        • Android SDK at C:\dev\android\sdk
        • Android NDK location not configured (optional; useful for native profiling support)
        • Platform android-28, build-tools 28.0.3
        • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
        • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
        • All Android licenses accepted.
    
    [!] Android Studio (version 3.3)
        • Android Studio at C:\Program Files\Android\Android Studio
        X Flutter plugin not installed; this adds Flutter specific functionality.
        X Dart plugin not installed; this adds Dart specific functionality.
        • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
    
    [√] IntelliJ IDEA Community Edition (version 2018.3)
        • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.3.4
        • Flutter plugin version 33.2.2
        • Dart plugin version 183.5901
    
    [!] VS Code, 64-bit edition (version 1.25.1)
        • VS Code at C:\Program Files\Microsoft VS Code
        X Flutter extension not installed; install from
          https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
    
    [√] Connected device (1 available)
        • Android SDK built for x86 • emulator-5554 • android-x86 • Android 8.1.0 (API 27) (emulator)
    
    ! Doctor found issues in 2 categories.
    
  • vovahost
    vovahost about 5 years
    Günter Zöchbauer I've enabled that option but still not applying the changes when I switch to the Emulator. I even restarted Intellij Idea. I've added the Screenshots of my current settings. Is it actually working for you ?
  • Günter Zöchbauer
    Günter Zöchbauer about 5 years
    Can you please add the output of flutter doctor -v? Or just check you have the latest version of IntelliJ, Flutter plugin, and perhaps try with Flutter beta or dev channel
  • vovahost
    vovahost about 5 years
    Günter Zöchbauer I've added the output of flutter doctor -v. I have the latest version of IDE and I also updated Flutter earlier today from dev channel.
  • Günter Zöchbauer
    Günter Zöchbauer about 5 years
    When you click into another IntelliJ window like terminal, does it hot-reload when a file was modified?
  • vovahost
    vovahost about 5 years
    Günter Zöchbauer No, it doesn't. I even tried switching tabs.
  • vovahost
    vovahost about 5 years
    Günter Zöchbauer Yes, it is saved. Just confirmed with another Editor so must be Flutter plugin or some other option.
  • Günter Zöchbauer
    Günter Zöchbauer about 5 years
  • vovahost
    vovahost about 5 years
    Günter Zöchbauer Probably not because in my case CTRL+S is bound to default Save all action. The strange thing is that if I trigger the save from Keyboard shortcut CTRL+S or using the Save button in Toolbar then the Hot reload is performed so it looks like a similar bug to what github.com/flutter/flutter-intellij/issues/1523 described.
  • Günter Zöchbauer
    Günter Zöchbauer about 5 years
    Ctrl+s shouldn't cause that. I'd suggest you create a bug report there or comment on an existing one if you think it's the same.