2011-04-22 72 views
1

所以使用回调开放的,这是我的清单:android系统不工作

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
     package="info.dierrelabs.h4m" 
     android:versionCode="1" 
     android:versionName="1.0"> 
    <uses-sdk android:minSdkVersion="7" /> 

    <application android:icon="@drawable/icon" android:label="@string/app_name"> 
     <activity android:name=".H4M" 
        android:label="@string/app_name"> 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 
       <category android:name="android.intent.category.LAUNCHER" /> 
       <category android:name="android.intent.category.BROWSABLE" /> 
       <data android:scheme="h4m-android-app" /> 
      </intent-filter> 
     </activity> 

    </application> 
    <uses-permission android:name="android.permission.INTERNET" /> 
</manifest> 

在我的活动我宣布我的URI为:

private static final Uri HT_CALLBACK_URI = Uri.parse("h4m-android-app:///"); 

但是当网站发送的用户回来我得到:

You don't have the permission to open this page h4m-android-app:///?oauth..blablabla 

我甚至用h4m-android-app://代替h4m-android-app:///但没有改变审判。

回答

3

伙计们,不要问我为什么,但我已经解决了分裂我的活动。基本上我不得不创建具有

<action android:name="android.intent.action.MAIN" /> 
<category android:name="android.intent.category.LAUNCHER" /> 

然后,你必须

<data android:scheme="h4m-android-app" /> 

您不能绑定一个Android第二活动的主要活动:方案,你必须MAINLAUNCHER

+1

“你不能绑定一个android:scheme到你有MAIN和LAUNCHER的地方”,这些话是这里的关键。花了我几个小时才弄明白。也检查了这一点:http://stackoverflow.com/questions/5545803/android-dev-callback-url-not-working-0-o – 2012-04-16 07:45:50

+0

这是在android ICS的工作 – nicky 2012-07-01 04:58:37