本文整理匯總了Java中com.google.android.youtube.player.YouTubeInitializationResult.isUserRecoverableError方法的典型用法代碼示例。如果您正苦於以下問題:Java YouTubeInitializationResult.isUserRecoverableError方法的具體用法?Java YouTubeInitializationResult.isUserRecoverableError怎麽用?Java YouTubeInitializationResult.isUserRecoverableError使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.android.youtube.player.YouTubeInitializationResult
的用法示例。
在下文中一共展示了YouTubeInitializationResult.isUserRecoverableError方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onActivityResult
import com.google.android.youtube.player.YouTubeInitializationResult; //導入方法依賴的package包/類
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
// called when playing a movie, could fail and this dialog shows the user how to fix it
case YouTubeAPI.REQ_PLAYER_CODE:
if (resultCode != RESULT_OK) {
YouTubeInitializationResult errorReason = YouTubeStandalonePlayer.getReturnedInitializationResult(data);
if (errorReason.isUserRecoverableError()) {
errorReason.getErrorDialog(this, 0).show();
} else {
String errorMessage = String.format("PLAYER ERROR!! - %s", errorReason.toString());
Utils.toast(this, errorMessage);
}
}
break;
default:
super.onActivityResult(requestCode, resultCode, data);
}
}
示例2: onInitializationFailure
import com.google.android.youtube.player.YouTubeInitializationResult; //導入方法依賴的package包/類
@Override
public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult youTubeInitializationResult) {
if (youTubeInitializationResult.isUserRecoverableError()) {
LogSaver.appendLog(TAG+" :"+youTubeInitializationResult.toString());
youTubeInitializationResult.getErrorDialog(this, RECOVERY_DIALOG_REQUEST).show();
} else {
String errorMessage = String.format(
getString(R.string.error_player), youTubeInitializationResult.toString());
Toast.makeText(this, errorMessage, Toast.LENGTH_LONG).show();
}
}
示例3: onActivityResult
import com.google.android.youtube.player.YouTubeInitializationResult; //導入方法依賴的package包/類
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == REQ_START_STANDALONE_PLAYER && resultCode != RESULT_OK) {
YouTubeInitializationResult errorReason =
YouTubeStandalonePlayer.getReturnedInitializationResult(data);
if (errorReason.isUserRecoverableError()) {
errorReason.getErrorDialog(this, 0).show();
} else {
String errorMessage =
String.format(getString(R.string.error_player), errorReason.toString());
Toast.makeText(this, errorMessage, Toast.LENGTH_LONG).show();
}
}
}
示例4: onInitializationFailure
import com.google.android.youtube.player.YouTubeInitializationResult; //導入方法依賴的package包/類
@Override
public void onInitializationFailure(YouTubePlayer.Provider provider,
YouTubeInitializationResult errorReason) {
if (errorReason.isUserRecoverableError()) {
errorReason.getErrorDialog(this, RECOVERY_DIALOG_REQUEST).show();
} else {
String errorMessage = String.format(getString(R.string.error_player), errorReason.toString());
Toast.makeText(this, errorMessage, Toast.LENGTH_LONG).show();
}
}
示例5: onInitializationFailure
import com.google.android.youtube.player.YouTubeInitializationResult; //導入方法依賴的package包/類
@Override
public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult youTubeInitializationResult) {
if (youTubeInitializationResult.isUserRecoverableError()) {
youTubeInitializationResult.getErrorDialog(getActivity(), RECOVERY_DIALOG_REQUEST).show();
} else {
//Handle the failure
Toast.makeText(getActivity(), "onInitializationFailure", Toast.LENGTH_LONG).show();
}
}
示例6: onInitializationFailure
import com.google.android.youtube.player.YouTubeInitializationResult; //導入方法依賴的package包/類
@Override
public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult errorReason) {
if (errorReason.isUserRecoverableError()) {
errorReason.getErrorDialog(this, RECOVERY_REQUEST).show();
} else {
String error = String.format("player error!", errorReason.toString());
Toast.makeText(this, error, Toast.LENGTH_LONG).show();
}
}
示例7: onInitializationFailure
import com.google.android.youtube.player.YouTubeInitializationResult; //導入方法依賴的package包/類
@Override
public void onInitializationFailure(YouTubePlayer.Provider provider,
YouTubeInitializationResult errorReason) {
if (errorReason.isUserRecoverableError()) {
errorReason.getErrorDialog(this, RECOVERY_DIALOG_REQUEST).show();
} else {
String errorMessage = String.format(
"There was an error initializing the YouTubePlayer (%1$s)",
errorReason.toString());
Toast.makeText(this, errorMessage, Toast.LENGTH_LONG).show();
}
}
示例8: onInitializationFailure
import com.google.android.youtube.player.YouTubeInitializationResult; //導入方法依賴的package包/類
@Override
public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult youTubeInitializationResult) {
if (youTubeInitializationResult.isUserRecoverableError()) {
youTubeInitializationResult.getErrorDialog(getActivity(), RECOVERY_DIALOG_REQUEST).show();
} else {
Toast.makeText(getActivity(), "The Youtube Player could'nt be initialized", Toast.LENGTH_LONG).show();
}
}
示例9: onInitializationFailure
import com.google.android.youtube.player.YouTubeInitializationResult; //導入方法依賴的package包/類
@Override
public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult youTubeInitializationResult) {
if (youTubeInitializationResult.isUserRecoverableError()) {
youTubeInitializationResult.getErrorDialog(getActivity(), RECOVERY_DIALOG_REQUEST).show();
} else {
if (isAdded()) {
Toast.makeText(getActivity().getApplicationContext(), getString(R.string.error_init_failure_msg), Toast.LENGTH_SHORT).show();
}
}
}
示例10: onActivityResult
import com.google.android.youtube.player.YouTubeInitializationResult; //導入方法依賴的package包/類
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == REQ_START_STANDALONE_PLAYER && resultCode != RESULT_OK) {
YouTubeInitializationResult errorReason =
YouTubeStandalonePlayer.getReturnedInitializationResult(data);
if (errorReason.isUserRecoverableError()) {
errorReason.getErrorDialog(this, 0).show();
} else {
String errorMessage =
String.format(getString(R.string.error_player), errorReason.toString());
Toast.makeText(this, errorMessage, Toast.LENGTH_LONG).show();
}
}
}
示例11: onInitializationFailure
import com.google.android.youtube.player.YouTubeInitializationResult; //導入方法依賴的package包/類
@Override
public void onInitializationFailure(
YouTubeThumbnailView thumbnailView, YouTubeInitializationResult errorReason) {
if (errorReason.isUserRecoverableError()) {
if (errorDialog == null || !errorDialog.isShowing()) {
errorDialog = errorReason.getErrorDialog(this, RECOVERY_DIALOG_REQUEST);
errorDialog.show();
}
} else {
String errorMessage =
String.format(getString(R.string.error_thumbnail_view), errorReason.toString());
Toast.makeText(this, errorMessage, Toast.LENGTH_LONG).show();
}
}
示例12: onInitializationFailure
import com.google.android.youtube.player.YouTubeInitializationResult; //導入方法依賴的package包/類
@Override
public void onInitializationFailure(YouTubePlayer.Provider provider,
YouTubeInitializationResult errorReason) {
if (errorReason.isUserRecoverableError()) {
errorReason.getErrorDialog(this, RECOVERY_DIALOG_REQUEST).show();
} else {
String errorMessage = String.format(getString(R.string.error_player), errorReason.toString());
Toast.makeText(this, errorMessage, Toast.LENGTH_LONG).show();
}
}
示例13: checkYouTubeApi
import com.google.android.youtube.player.YouTubeInitializationResult; //導入方法依賴的package包/類
private void checkYouTubeApi() {
YouTubeInitializationResult errorReason =
YouTubeApiServiceUtil.isYouTubeApiServiceAvailable(this);
if (errorReason.isUserRecoverableError()) {
errorReason.getErrorDialog(this, RECOVERY_DIALOG_REQUEST).show();
} else if (errorReason != YouTubeInitializationResult.SUCCESS) {
String errorMessage =
String.format(getString(R.string.error_player), errorReason.toString());
Toast.makeText(this, errorMessage, Toast.LENGTH_LONG).show();
}
}
示例14: onInitializationFailure
import com.google.android.youtube.player.YouTubeInitializationResult; //導入方法依賴的package包/類
@Override
public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult errorResult) {
if (errorResult.isUserRecoverableError()) {
errorResult.getErrorDialog(getActivity(), RECOVERY_REQUEST).show();
} else {
String error = String.format(getString(R.string.player_error), errorResult.toString());
Toast.makeText(getActivity(), error, Toast.LENGTH_LONG).show();
}
}
示例15: onInitializationFailure
import com.google.android.youtube.player.YouTubeInitializationResult; //導入方法依賴的package包/類
@Override
public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult errorResult) {
if (errorResult.isUserRecoverableError()) {
errorResult.getErrorDialog(this, RECOVERY_REQUEST).show();
} else {
String error = String.format(getString(R.string.player_error), errorResult.toString());
Toast.makeText(this, error, Toast.LENGTH_LONG).show();
}
}