[Resurrected! ] How to turn on a Desktop PC?
- Laptops & Computers
- 16 Replies
I'll get the switch repaired when I can.
Question removed.
Question removed.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
private void login() {
Login login = new Login(this);
login.makeRequest(new Callback<String>() {
@Override
public void onComplete(Result<String> result) {
if (result instanceof Result.Success) {
Intent dsp = new Intent(LoginActivity.this, MainActivity.class);
startActivity(dsp);
} else {
Result.Error<String> error = (Result.Error<String>) result;
Toast.makeText(getApplicationContext(), error.message, Toast.LENGTH_SHORT).show();
}
}
}, usernameEt.getText().toString(), passwordEt.getText().toString());
}
public void makeRequest(final Callback<String> callback, final String username, final String password) {
new Thread(new Runnable() {
@Override
public void run() {
final Result<String> result = makeSynchronousRequest(username, password);
callback.execute(result, callingActivity);
}
}).start();
}
public abstract class Callback<T> {
public abstract void onComplete(Result<T> result);
public void execute(final Result<T> result, AppCompatActivity callingActivity) {
callingActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
onComplete(result);
}
});
}
}