Properly flush an intent after the data is handled

Add a missing bracket for the intent cancellation
This commit is contained in:
TwistedUmbrella 2015-01-25 15:47:40 -05:00
parent 30cfc0b15a
commit cb555bc06f
1 changed files with 5 additions and 1 deletions

View File

@ -136,8 +136,12 @@ public class MainActivity extends SlidingFragmentActivity implements
// When viewing a resource, pass its URI to the native code for opening
Intent intent = getIntent();
if (intent.getAction() != null) {
if (intent.getAction().equals(Intent.ACTION_VIEW))
if (intent.getAction().equals(Intent.ACTION_VIEW)) {
onGameSelected(Uri.parse(intent.getData().toString()));
// Flush the intent to prevent multiple calls
getIntent().setData(null);
setIntent(null);
}
}
// Check that the activity is using the layout version with