-
Notifications
You must be signed in to change notification settings - Fork 965
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Catch ActivityNotFound exception to prevent crashes
- Loading branch information
Showing
8 changed files
with
31 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
source/SupportLib/PlayGamesPluginSupport/src/main/java/com/google/games/bridge/Utils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.google.games.bridge; | ||
|
||
import android.app.Fragment; | ||
import android.content.ActivityNotFoundException; | ||
import android.content.Intent; | ||
import android.util.Log; | ||
|
||
/** | ||
* Utility functions | ||
*/ | ||
public final class Utils { | ||
|
||
private static final String TAG = "Utils"; | ||
|
||
private Utils() {} | ||
|
||
public static void startActivityForResult(Fragment fragment, Intent intent, int requestCode) { | ||
try { | ||
fragment.startActivityForResult(intent, requestCode); | ||
} catch (ActivityNotFoundException e) { | ||
Log.e(TAG,"Activity not found. Please install Play Games App."); | ||
} | ||
} | ||
} |