Skip to content

Commit 9b57e85

Browse files
committed
Add browsable category to action view intent before starting
This ensures the GitHub app is not shown as a possible target for the sign up link since that must be done from a browser.
1 parent 95f4eef commit 9b57e85

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

app/src/main/java/com/github/mobile/accounts/LoginActivity.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
import static android.accounts.AccountManager.KEY_ACCOUNT_TYPE;
2020
import static android.accounts.AccountManager.KEY_AUTHTOKEN;
2121
import static android.accounts.AccountManager.KEY_BOOLEAN_RESULT;
22+
import static android.content.Intent.ACTION_VIEW;
23+
import static android.content.Intent.CATEGORY_BROWSABLE;
2224
import static android.view.KeyEvent.ACTION_DOWN;
2325
import static android.view.KeyEvent.KEYCODE_ENTER;
2426
import static android.view.inputmethod.EditorInfo.IME_ACTION_DONE;
@@ -226,6 +228,14 @@ private void updateEnablement() {
226228
loginItem.setEnabled(loginEnabled());
227229
}
228230

231+
@Override
232+
public void startActivity(Intent intent) {
233+
if (intent != null && ACTION_VIEW.equals(intent.getAction()))
234+
intent.addCategory(CATEGORY_BROWSABLE);
235+
236+
super.startActivity(intent);
237+
}
238+
229239
/**
230240
* Authenticate login & password
231241
*/

0 commit comments

Comments
 (0)