- mongodb - 在 MongoDB mapreduce 中,如何展平值对象?
- javascript - 对象传播与 Object.assign
- html - 输入类型 ="submit"Vs 按钮标签它们可以互换吗?
- sql - 使用 MongoDB 而不是 MS SQL Server 的优缺点
我正在学习教程 here ,并且正在到达那里错误 The method getIntentSender() is undefined for type ConnectionResult
in the onConnectionFailed
类。
完整代码
package com.alfalfa.thisthat;
import android.app.Activity;
import android.content.Intent;
import android.content.IntentSender.SendIntentException;
import android.os.Bundle;
import android.view.Menu;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks;
import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener;
import com.google.android.gms.plus.Plus;
public class LoginActivity extends Activity implements
ConnectionCallbacks, OnConnectionFailedListener {
/* Request code used to invoke sign in user interactions. */
private static final int RC_SIGN_IN = 0;
/* Client used to interact with Google APIs. */
private GoogleApiClient mGoogleApiClient;
/* A flag indicating that a PendingIntent is in progress and prevents
* us from starting further intents.
*/
private boolean mIntentInProgress;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(Plus.API, null)
.addScope(Plus.SCOPE_PLUS_LOGIN)
.build();
}
protected void onStart() {
super.onStart();
mGoogleApiClient.connect();
}
protected void onStop() {
super.onStop();
if (mGoogleApiClient.isConnected()) {
mGoogleApiClient.disconnect();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public void onConnectionFailed(ConnectionResult result) {
if (!mIntentInProgress && result.hasResolution()) {
try {
mIntentInProgress = true;
startIntentSenderForResult(result.getIntentSender(),
RC_SIGN_IN, null, 0, 0, 0);
} catch (SendIntentException e) {
// The intent was canceled before it was sent. Return to the default
// state and attempt to connect to get an updated ConnectionResult.
mIntentInProgress = false;
mGoogleApiClient.connect();
}
}
}
@Override
public void onConnected(Bundle connectionHint) {
// We've resolved any connection errors. mGoogleApiClient can be used to
// access Google APIs on behalf of the user.
}
@Override
public void onConnectionSuspended(int cause) {
mGoogleApiClient.connect();
}
protected void onActivityResult(int requestCode, int responseCode, Intent intent) {
if (requestCode == RC_SIGN_IN) {
mIntentInProgress = false;
if (!mGoogleApiClient.isConnecting()) {
mGoogleApiClient.connect();
}
}
}
}
编辑:日志猫
02-13 19:12:31.763: E/AndroidRuntime(21257): FATAL EXCEPTION: main
02-13 19:12:31.763: E/AndroidRuntime(21257): Process: com.alfalfa.thisthat, PID: 21257
02-13 19:12:31.763: E/AndroidRuntime(21257): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.alfalfa.thisthat/com.alfalfa.thisthat.MainActivity}: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.alfalfa.thisthat/com.alfalfa.thisthat.LoginActivity}; have you declared this activity in your AndroidManifest.xml?
02-13 19:12:31.763: E/AndroidRuntime(21257): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
02-13 19:12:31.763: E/AndroidRuntime(21257): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
02-13 19:12:31.763: E/AndroidRuntime(21257): at android.app.ActivityThread.access$800(ActivityThread.java:135)
02-13 19:12:31.763: E/AndroidRuntime(21257): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
02-13 19:12:31.763: E/AndroidRuntime(21257): at android.os.Handler.dispatchMessage(Handler.java:102)
02-13 19:12:31.763: E/AndroidRuntime(21257): at android.os.Looper.loop(Looper.java:136)
02-13 19:12:31.763: E/AndroidRuntime(21257): at android.app.ActivityThread.main(ActivityThread.java:5017)
02-13 19:12:31.763: E/AndroidRuntime(21257): at java.lang.reflect.Method.invokeNative(Native Method)
02-13 19:12:31.763: E/AndroidRuntime(21257): at java.lang.reflect.Method.invoke(Method.java:515)
02-13 19:12:31.763: E/AndroidRuntime(21257): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
02-13 19:12:31.763: E/AndroidRuntime(21257): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
02-13 19:12:31.763: E/AndroidRuntime(21257): at dalvik.system.NativeStart.main(Native Method)
02-13 19:12:31.763: E/AndroidRuntime(21257): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.alfalfa.thisthat/com.alfalfa.thisthat.LoginActivity}; have you declared this activity in your AndroidManifest.xml?
02-13 19:12:31.763: E/AndroidRuntime(21257): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1628)
02-13 19:12:31.763: E/AndroidRuntime(21257): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1424)
02-13 19:12:31.763: E/AndroidRuntime(21257): at android.app.Activity.startActivityForResult(Activity.java:3424)
02-13 19:12:31.763: E/AndroidRuntime(21257): at android.app.Activity.startActivityForResult(Activity.java:3385)
02-13 19:12:31.763: E/AndroidRuntime(21257): at android.app.Activity.startActivity(Activity.java:3627)
02-13 19:12:31.763: E/AndroidRuntime(21257): at android.app.Activity.startActivity(Activity.java:3595)
02-13 19:12:31.763: E/AndroidRuntime(21257): at com.alfalfa.thisthat.MainActivity.onCreate(MainActivity.java:16)
02-13 19:12:31.763: E/AndroidRuntime(21257): at android.app.Activity.performCreate(Activity.java:5231)
02-13 19:12:31.763: E/AndroidRuntime(21257): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
02-13 19:12:31.763: E/AndroidRuntime(21257): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
02-13 19:12:31.763: E/AndroidRuntime(21257): ... 11 more
最佳答案
截至今天和 Google Play SDK 版本 15,这已被替换为
result.startResolutionForResult(this, // your activity
RC_SIGN_IN);
根据更新的 documentation .
关于android - 在android中实现google play服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21767594/
所以我的应用程序的评论显示在我的游戏控制台中,但是由于某种原因,当我在 google Play 商店上访问我的应用程序链接并以普通用户的身份查看它时,我没有收到新评论的通知,我的显示了 13 条评论,
一旦我在 2.3 play 项目上运行 'sbt compile',我就不能再使用 'sbt compile' 来编译任何 Play 2.2.x 项目。这是我运行 sbt 命令时的错误。 [info]
我有点困惑,想得到一个解释。 我正在使用 Java Play 2 和 Akka Actor 。我使用 play run 启动系统。 不过,我刚刚看到一个视频,使用了命令: play akka star
当我玩游戏时,我遇到两个选择play.api.mvc和 play.mvc包裹 有什么不同? 最佳答案 从戏! 2 文档: The API available in the play.api packa
从 2.3 迁移到 2.4 后,我收到此错误。我应该使用的正确导入语句是什么? error: value routesImport is not a member of object play.Pla
所以我在 google play 上有一个应用程序已经将近 6 个月了,最近两个月我更新了我的应用程序屏幕截图,从那时起,每次我更新我的应用程序时,我都开始收到应用程序拒绝。 上次我提出上诉并被接受,
我有以下代码: Snapshots.OpenSnapshotResult result; result = Games.Snapshots.open(googleApiClient, "save",
在过去 72 小时内,我为 Google Play 开发者计划支付的 Google 电子钱包付款显示为“您的购买正在处理中”。我知道这可能需要长达 48 小时,但这是他们处理时间最坏情况之后的一整天。
我在 Play 商店发布了应用程序,我不知道为什么应用程序显示预注册,我想为我的用户提供直接下载选项。伸出援手将不胜感激。 最佳答案 instructions for pre-registration
我有一个 PHP 后端,它与 Google Play 服务集成以验证从 APP 进行的购买。购买信息返回收据和签名,我需要验证购买是否正确。 我收到: { ...rest of the data
我在 Google Play Developer Console 上创建了我的 Android 应用程序的草稿。我已经填写了所有需要的信息。必需的步骤之一是“内容评级”。我已填写表格以自动分配 Goo
我已经设置好了 com.typesafe.play play_2.13 2.7.4 在项目 pom.xml 中。但是,当我尝试遵循this tutorial时,语句 pla
我在 Play 商店上发布了一个应用程序,并收到了一些评论。在Google Play开发者控制台中,我在一些评论中看不到应用程序的版本。这是我在“应用程序”标题下找到的内容。 版本代码 — 版本名称
假设 A 是所有者。我希望我们团队的 B、C 和 D 用户能够上传我们应用程序的新版本。这可能吗?来自 this我不太清楚用户有什么样的权限。如果有人对这部分有任何经验,欢迎。 最佳答案 您需要 go
我正在尝试将应用重新提交到 Google Play,但我似乎可以找到一种技术上的方法来实现此目的。 我对“您的应用主要针对 COPPA 定义的 13 岁以下 child 吗?”的回答是肯定的,然后在不
我想分享一下我在分析 Google Play 控制台的新功能时遇到的情况,并尝试找到解决方案。 正如你们许多人可能已经知道的那样,Google 已在 Google Play 控制台上发布了更新并引入了
我有两个用 playframework 编写的应用程序。我想加入另一个。我有一个数据库,我想在它们之间共享我的登录类。应用程序对类、方法、变量使用不同的名称。 我怎样才能实现它?我应该创建 jar 版
对于我的硕士论文,我需要自动将来自 Google Play 的不同 Android 应用程序的信息写入一个文本文件。所以我使用 perl 脚本语言来实现这种自动化。我的 perl 脚本可以在 Goog
我想测试子项目是如何工作的,尤其是 routes在主项目 ( this was not visible before ) 中考虑了子项目的数量。 我在这里阅读了文档: https://github.c
我正在使用 Play 框架 2.1.2,我有一个 handlere 方法返回一个 Promise,如 Play 的 2.1.2 documentation 中所述 但是 Play 抛出编译错误说: C
我是一名优秀的程序员,十分优秀!