Aman-Malhotra / Volume_Flutter

Now you can change android volumes in Flutter. You can change MEDIA volume, NOTIFICATION volume, RING Volume, VOICE CALL Volume, ALARM Volume and SYSTEM Volume. This is exclusively for android right now because I don't have max to do the IOS coding and I don't have experience in IOS coding as well. Pull requests for IOS Implementation are welcome.
MIT License
23 stars 31 forks source link

Bug in the java Code #5

Closed gdo closed 4 years ago

gdo commented 4 years ago

Hello,

You need to add result.success(0); to the controlVolume method otherwise the line await Volume.controlVolume(audioManager); in the dart code never finish

Here :

@Override
public void onMethodCall(MethodCall call, Result result) {
        if (call.method.equals("controlVolume")) {
            int i = call.argument("streamType");
            streamType = i;
            controlVolume(i);
///////////////////////////////////////////////
            result.success(0);
///////////////////////////////////////////////
        } else if (call.method.equals("getMaxVol")) {
......
 }
Aman-Malhotra commented 4 years ago

Hello,

You need to add result.success(0); to the controlVolume method otherwise the line await Volume.controlVolume(audioManager); in the dart code never finish

Here :

@Override
public void onMethodCall(MethodCall call, Result result) {
        if (call.method.equals("controlVolume")) {
            int i = call.argument("streamType");
            streamType = i;
            controlVolume(i);
///////////////////////////////////////////////
            result.success(0);
///////////////////////////////////////////////
        } else if (call.method.equals("getMaxVol")) {
......
 }

Sorry for the late update . This issue was resolved by geisterfurz007 and this is updated in the version 0.1.3