Skip to content
This repository has been archived by the owner on Mar 2, 2019. It is now read-only.

Commit

Permalink
view intent in App Class requires NEW_TASK flag
Browse files Browse the repository at this point in the history
  • Loading branch information
doowzs committed Dec 9, 2018
1 parent 747543a commit 178455c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
11 changes: 4 additions & 7 deletions app/src/main/java/com/doowzs/jbapp/JBAppApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,15 @@ public void onResponse(JSONObject data) {
@Override
public void onClick(DialogInterface dialog, int which) {
try {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(version.getString("link"))));
startActivity(new Intent(Intent.ACTION_VIEW,
Uri.parse(version.getString("link")))
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
} catch (JSONException jex) {
Log.e("UpdateIntent", jex.getLocalizedMessage());
}
}
})
.setNegativeButton(android.R.string.no, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
//
}
})
.setNegativeButton(android.R.string.no, null)
.show();
Log.d("debug", "Request Finished.");
}
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/java/com/doowzs/jbapp/LoginActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
Expand All @@ -34,6 +35,7 @@
import java.util.HashMap;
import java.util.Map;

import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;

/**
Expand All @@ -54,6 +56,7 @@ public class LoginActivity extends AppCompatActivity {
Context mContext = null;

// UI references.
private AlertDialog.Builder mBuilder = null;
private TextInputEditText mStudentIDView;
private TextInputEditText mPasswordView;
private View mProgressView;
Expand All @@ -70,6 +73,10 @@ protected void onCreate(Bundle savedInstanceState) {
mIndent = getIntent();
mContext = getBaseContext();

// Check app update
mBuilder = new AlertDialog.Builder(LoginActivity.this);
mQueue.add(mApp.checkUpdateRequest(mBuilder));

// Set up the login form.
mStudentIDView = (TextInputEditText) findViewById(R.id.student_id);
mPasswordView = (TextInputEditText) findViewById(R.id.password);
Expand Down
3 changes: 0 additions & 3 deletions app/src/main/java/com/doowzs/jbapp/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,6 @@ public void onRefresh() {
Toast.makeText(this, jex.getLocalizedMessage(), Toast.LENGTH_LONG).show();
}

// Check app update
mQueue.add(mApp.checkUpdateRequest(mBuilder));

// Fetch latest assignments
mGetAssignmentsTask = new GetAssignmentsTask();
mGetAssignmentsTask.execute();
Expand Down
8 changes: 4 additions & 4 deletions app/version.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Sun Dec 09 22:49:32 CST 2018
VERSION_NUMBER=1
VERSION_BUILD=235
VERSION_PATCH=0
#Sun Dec 09 23:08:09 CST 2018
VERSION_NUMBER=2
VERSION_BUILD=241
VERSION_PATCH=1

0 comments on commit 178455c

Please sign in to comment.