mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2025-12-21 09:01:56 -07:00
- Added deprecated FileObserver Constructor for older APIs
This commit is contained in:
parent
4fcfbd2ab8
commit
5a5dc351f0
1 changed files with 19 additions and 8 deletions
|
|
@ -105,15 +105,26 @@ public class MainActivity extends BaseMainActivity {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.P){
|
||||||
|
fileObserver = new FileObserver(new File(Tools.DIR_GAME_NEW + "/options.txt"), FileObserver.MODIFY) {
|
||||||
|
@Override
|
||||||
|
public void onEvent(int i, @Nullable String s) {
|
||||||
|
//FIXME Make sure the multithreading nature of this event doesn't cause any problems ?
|
||||||
|
MCOptionUtils.load();
|
||||||
|
getMcScale();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}else{
|
||||||
|
fileObserver = new FileObserver(Tools.DIR_GAME_NEW + "/options.txt", FileObserver.MODIFY) {
|
||||||
|
@Override
|
||||||
|
public void onEvent(int i, @Nullable String s) {
|
||||||
|
//FIXME Make sure the multithreading nature of this event doesn't cause any problems ?
|
||||||
|
MCOptionUtils.load();
|
||||||
|
getMcScale();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
fileObserver = new FileObserver(new File(Tools.DIR_GAME_NEW + "/options.txt"), FileObserver.MODIFY) {
|
|
||||||
@Override
|
|
||||||
public void onEvent(int i, @Nullable String s) {
|
|
||||||
//FIXME Make sure the multithreading nature of this event doesn't cause any problems ?
|
|
||||||
MCOptionUtils.load();
|
|
||||||
getMcScale();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
fileObserver.startWatching();
|
fileObserver.startWatching();
|
||||||
|
|
||||||
ControlData[] specialButtons = ControlData.getSpecialButtons();
|
ControlData[] specialButtons = ControlData.getSpecialButtons();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue