(ポスト動作するコード用に更新)Android、Twitter、OAuth:プロトコルがサポートされていませんか?
私は私のAndroidアプリは、Twitterで承認した後、私のアプリでは、コールバックURLと認証トークンをキャッチするために取得しようとしてきました。
私はAndroidManifest.xmlでも何か問題があると思います。私が理解しているところから、アンドロイド:launchmode = "singleTask"を使ってアプリケーションを起動すると、メインアクティビティのonResume()メソッドでAccessTokenオブジェクトを取得する必要があります。
singleTaskの起動を指定しない場合は、代わりにonNewIntent()メソッドで取得する必要があります。
マニフェストファイルで両方の方法を試しましたが、onNewIntent()またはonResume()でコントロールできません。 Twitterは自分のコールバックURLでリダイレクトされますが、Webブラウザは「Webページが利用できません」と表示します。 logcatさんのコメント:
Tab E onReceivedError -10 myapp://www.authtoke.app?oauth_token=2Y3jZMfHZ06Teezzy3l1KvlWqs961tsqXFlTgMHrA&oauth_verifier=PBfCueZLEzEteBoLTksDARQDRi3raVi5FiEJllCYus The protocol is not supported.
誰でも私が掘り下げたものを知っていますか?マニフェストエントリは次のとおりです。
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.test.twitterLib"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="4" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:name=".myAppVars" android:icon="@drawable/ic_launcher" android:label="@string/app_name" >
<activity android:name=".TwitterLibActivity" android:label="@string/app_name" android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" > </action>
<category android:name="android.intent.category.LAUNCHER" ></category>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" > </action>
<category android:name="android.intent.category.DEFAULT" ></category>
<category android:name="android.intent.category.BROWSABLE" > </category>
<data android:scheme="myapp" android:host="www.authtoke.app"> </data>
</intent-filter>
</activity>
</application>
</manifest>
答えはhttp://androidforums.com/introductions/218621-twitter4j-oauth-android-simple.htmlで見つかりました。編集されたマニフェストが動作するようにします。 VIEW、DEFAULTおよびBROWSABLE項目を2番目のインテント・フィルター・スタンザに移動しました。 – wufoo
Yousはあなたの答えを以下に加え、解決したはずです。 – brk3