gpt4 book ai didi

android - 由于 SocialAuth 库项目而崩溃

转载 作者:行者123 更新时间:2023-11-29 01:40:53 24 4
gpt4 key购买 nike

我在添加(谷歌的)社交身份验证库项目时遇到问题。

有两个jar文件使用了socialauth-2.3和socialauth-android

public void onClick(View v) {
// TODO Auto-generated method stub
switch (v.getId()) {
case R.id.fbLogin:
adapter = new SocialAuthAdapter(new ResponseListener()); //<----- after this it crashes
wmbPreference = PreferenceManager.getDefaultSharedPreferences(this);
boolean isFirstRun = wmbPreference.getBoolean("FIRSTRUN", true);
adapter.authorize(LoginActivity.this, Provider.FACEBOOK);
adapter.addProvider(Provider.FACEBOOK, R.drawable.apppurchase);
break;

case R.id.loginWithExistingAccount:
new SignInDialog(context, typeface);
break;
case R.id.createNewAccount:
new SignUpDialog(context, typeface, imeiString);
break;

default:
break;
}

}

下面是我的logcat

07-15 12:05:20.498: E/AndroidRuntime(1353): FATAL EXCEPTION: main
07-15 12:05:20.498: E/AndroidRuntime(1353): Process: com.example.puzzleapplication, PID: 1353
07-15 12:05:20.498: E/AndroidRuntime(1353): android.content.res.Resources$NotFoundException: Resource ID #0x0
07-15 12:05:20.498: E/AndroidRuntime(1353): at android.content.res.Resources.getValue(Resources.java:1123)
07-15 12:05:20.498: E/AndroidRuntime(1353): at android.content.res.Resources.getDrawable(Resources.java:698)
07-15 12:05:20.498: E/AndroidRuntime(1353): at org.brickred.socialauth.android.SocialAuthDialog.setUpTitle(SocialAuthDialog.java:181)
07-15 12:05:20.498: E/AndroidRuntime(1353): at org.brickred.socialauth.android.SocialAuthDialog.onCreate(SocialAuthDialog.java:143)
07-15 12:05:20.498: E/AndroidRuntime(1353): at android.app.Dialog.dispatchOnCreate(Dialog.java:361)
07-15 12:05:20.498: E/AndroidRuntime(1353): at android.app.Dialog.show(Dialog.java:262)
07-15 12:05:20.498: E/AndroidRuntime(1353): at org.brickred.socialauth.android.SocialAuthAdapter$3$1.run(SocialAuthAdapter.java:418)
07-15 12:05:20.498: E/AndroidRuntime(1353): at android.os.Handler.handleCallback(Handler.java:733)
07-15 12:05:20.498: E/AndroidRuntime(1353): at android.os.Handler.dispatchMessage(Handler.java:95)
07-15 12:05:20.498: E/AndroidRuntime(1353): at android.os.Looper.loop(Looper.java:136)
07-15 12:05:20.498: E/AndroidRuntime(1353): at android.app.ActivityThread.main(ActivityThread.java:5017)
07-15 12:05:20.498: E/AndroidRuntime(1353): at java.lang.reflect.Method.invokeNative(Native Method)
07-15 12:05:20.498: E/AndroidRuntime(1353): at java.lang.reflect.Method.invoke(Method.java:515)
07-15 12:05:20.498: E/AndroidRuntime(1353): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
07-15 12:05:20.498: E/AndroidRuntime(1353): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
07-15 12:05:20.498: E/AndroidRuntime(1353): at dalvik.system.NativeStart.main(Native Method)

你们能帮我把它整理出来吗

问候

最佳答案

您必须像在示例项目中那样输入可绘制对象的名称:

放:

adapter.addProvider(Provider.FACEBOOK, R.drawable.facebook);

代替:

adapter.addProvider(Provider.FACEBOOK, R.drawable.apppurchase);

他们会成功的。

关于android - 由于 SocialAuth 库项目而崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24751471/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com