2011-04-22 132 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