Tidying up Authenticate activity

This commit is contained in:
Graham Jones
2022-01-26 19:15:52 +00:00
parent bdd7b49358
commit 27a508ce88
3 changed files with 7 additions and 14 deletions

View File

@@ -85,19 +85,6 @@ public class AuthenticateActivity extends AppCompatActivity {
mWac = mConnection.mSdServer.mLm.mWac;
}
//public void authCallback(boolean authSuccess, String tokenStr) {
//Log.v(TAG,"authCallback");
// updateUi();
//}
public void eventCallback(boolean success, String eventStr) {
Log.v(TAG,"eventCallback");
}
public void datapointCallback(boolean success, String datapointStr) {
Log.v(TAG,"datapointCallback");
}
private void updateUi() {
SharedPreferences prefs;
String storedAuthToken;
@@ -146,8 +133,13 @@ public class AuthenticateActivity extends AppCompatActivity {
mWac.authenticate(uname,passwd, (String retVal) -> {
if (retVal != null) {
Log.d(TAG,"Authentication Success - token is "+retVal);
mUtil.showToast("Login Successful");
saveAuthToken(retVal);
updateUi();
} else {
Log.e(TAG,"onOk: Authentication failure for "+uname+", "+passwd);
mUtil.showToast("ERROR: Authentication Failed - Please Try Again");
mUtil.writeToSysLogFile("AuthActivity - Authorisation failed for "+uname+", "+passwd);
}
});
//finish();

View File

@@ -50,7 +50,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/cancel" />
android:text="@string/back" />
<Button
android:id="@+id/OKBtn"

View File

@@ -325,4 +325,5 @@
<string name="selectFromOptionselow">"-- select option --"</string>
<string name="waitingForData">...waiting for data...</string>
<string name="refreshBtn">Refresh</string>
<string name="back">Back</string>
</resources>