本文整理汇总了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();
}
}