mirror of
https://github.com/DanielPollithy/flashwifi.git
synced 2025-10-16 11:45:32 +00:00
App switch crash fix and Settings Listener case update
-Fixed error where unregisterReceiver would crash app if no BroadcastReceiver was registered -Update settings UI
This commit is contained in:
parent
3e09483564
commit
001b25dae4
@ -123,9 +123,14 @@ public class MainActivity extends AppCompatActivity
|
|||||||
@Override
|
@Override
|
||||||
protected void onStop() {
|
protected void onStop() {
|
||||||
super.onStop();
|
super.onStop();
|
||||||
unregisterReceiver(updateUIReceiver);
|
|
||||||
|
try {unregisterReceiver(updateUIReceiver);
|
||||||
unbindService(mConnection);
|
unbindService(mConnection);
|
||||||
}
|
}
|
||||||
|
catch(IllegalArgumentException e) {
|
||||||
|
System.out.println(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
|||||||
@ -43,11 +43,20 @@ public class SettingsFragment extends PreferenceFragment implements SharedPrefer
|
|||||||
case "pref_key_switch_testnet":
|
case "pref_key_switch_testnet":
|
||||||
Toast.makeText(getActivity(), "Testnet on/off Changed", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "Testnet on/off Changed", Toast.LENGTH_SHORT).show();
|
||||||
break;
|
break;
|
||||||
|
case "edit_text_sell_price":
|
||||||
|
Toast.makeText(getActivity(), "Hotspot Sell Price Changed", Toast.LENGTH_SHORT).show();
|
||||||
|
break;
|
||||||
|
case "edit_text_sell_min_minutes":
|
||||||
|
Toast.makeText(getActivity(), "Hotspot Min sell duration changed", Toast.LENGTH_SHORT).show();
|
||||||
|
break;
|
||||||
|
case "edit_text_sell_max_minutes":
|
||||||
|
Toast.makeText(getActivity(), "Hotspot Max sell duration changed", Toast.LENGTH_SHORT).show();
|
||||||
|
break;
|
||||||
case "edit_text_buy_price":
|
case "edit_text_buy_price":
|
||||||
Toast.makeText(getActivity(), "Buy Price Changed", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "Buy Price Changed", Toast.LENGTH_SHORT).show();
|
||||||
break;
|
break;
|
||||||
case "edit_text_sell_price":
|
case "edit_text_client_minutes":
|
||||||
Toast.makeText(getActivity(), "Sell Price Changed", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "Client duration duration changed", Toast.LENGTH_SHORT).show();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
android:divider="@null"
|
android:divider="@null"
|
||||||
android:dividerHeight="0dp"
|
android:dividerHeight="0dp"
|
||||||
android:key="pref_key_reset_data_usage"
|
android:key="pref_key_reset_data_usage"
|
||||||
android:title="Reset Data Usage"/>
|
android:title="Reset data usage"/>
|
||||||
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
@ -32,7 +32,7 @@
|
|||||||
android:key="pref_key_network_timeout"
|
android:key="pref_key_network_timeout"
|
||||||
android:entries="@array/networkTimeoutPref"
|
android:entries="@array/networkTimeoutPref"
|
||||||
android:entryValues="@array/networkTimeoutPref"
|
android:entryValues="@array/networkTimeoutPref"
|
||||||
android:title="Network Timeout" />
|
android:title="Network timeout" />
|
||||||
|
|
||||||
<ListPreference
|
<ListPreference
|
||||||
android:key="pref_key_units"
|
android:key="pref_key_units"
|
||||||
@ -65,23 +65,23 @@
|
|||||||
android:inputType="number"
|
android:inputType="number"
|
||||||
android:selectAllOnFocus="true"
|
android:selectAllOnFocus="true"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:title="Sell Price" />
|
android:title="Sell price" />
|
||||||
|
|
||||||
<EditTextPreference
|
<EditTextPreference
|
||||||
android:defaultValue="15"
|
android:defaultValue="15"
|
||||||
android:key="edit_text_min_minutes"
|
|
||||||
android:inputType="number"
|
android:inputType="number"
|
||||||
|
android:key="edit_text_sell_min_minutes"
|
||||||
android:selectAllOnFocus="true"
|
android:selectAllOnFocus="true"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:title="Minimum selling durance [minutes]" />
|
android:title="Minimum sell duration (minutes)" />
|
||||||
|
|
||||||
<EditTextPreference
|
<EditTextPreference
|
||||||
android:defaultValue="100"
|
android:defaultValue="100"
|
||||||
android:key="edit_text_max_minutes"
|
android:key="edit_text_sell_max_minutes"
|
||||||
android:inputType="number"
|
android:inputType="number"
|
||||||
android:selectAllOnFocus="true"
|
android:selectAllOnFocus="true"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:title="Maximum selling durance [minutes]" />
|
android:title="Maximum sell duration (minutes)" />
|
||||||
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
@ -96,7 +96,7 @@
|
|||||||
android:inputType="number"
|
android:inputType="number"
|
||||||
android:selectAllOnFocus="true"
|
android:selectAllOnFocus="true"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:title="Max Buy Price" />
|
android:title="Max buy price" />
|
||||||
|
|
||||||
<EditTextPreference
|
<EditTextPreference
|
||||||
android:defaultValue="60"
|
android:defaultValue="60"
|
||||||
@ -104,7 +104,7 @@
|
|||||||
android:inputType="number"
|
android:inputType="number"
|
||||||
android:selectAllOnFocus="true"
|
android:selectAllOnFocus="true"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:title="Client roaming durance" />
|
android:title="Client roaming duration" />
|
||||||
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user