Fix file selection for module install

This commit is contained in:
topjohnwu 2017-11-17 01:39:34 +08:00
parent e1ef732b60
commit 27d5858e06
2 changed files with 16 additions and 0 deletions

View File

@ -92,6 +92,11 @@ public class Activity extends AppCompatActivity {
activityResultListener = null;
}
@Override
public void startActivityForResult(Intent intent, int requestCode) {
startActivityForResult(intent, requestCode, this::onActivityResult);
}
public void startActivityForResult(Intent intent, int requestCode, ActivityResultListener listener) {
activityResultListener = listener;
super.startActivityForResult(intent, requestCode);

View File

@ -1,5 +1,7 @@
package com.topjohnwu.magisk.components;
import android.content.Intent;
import com.topjohnwu.magisk.MagiskManager;
import com.topjohnwu.magisk.utils.Topic;
import com.topjohnwu.magisk.utils.Utils;
@ -25,4 +27,13 @@ public class Fragment extends android.support.v4.app.Fragment {
}
super.onPause();
}
@Override
public void startActivityForResult(Intent intent, int requestCode) {
startActivityForResult(intent, requestCode, this::onActivityResult);
}
public void startActivityForResult(Intent intent, int requestCode, Activity.ActivityResultListener listener) {
((Activity) getActivity()).startActivityForResult(intent, requestCode, listener);
}
}