Question

Hi I am creating a app in which I used twitter4j lib for integration of twitter in my app which works successfully for below 2.3 but when I run application on 4.o application gets closed. Here : 1. I used default browser for twitter 2. and I want to use Web view instead of browser. So How to deal with twitter lib using web view ? to use browser I do following changes in AndroidMainfest.xml

<intent-filter>
            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="oauth" android:host="t4jsample"/>
        </intent-filter>

No correct solution

OTHER TIPS

For versions greater than 9 add the following code

if (android.os.Build.VERSION.SDK_INT > 9) {
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder()
                .permitAll().build();
    StrictMode.setThreadPolicy(policy);
  }

This (http://www.androidhive.info/2012/09/android-twitter-oauth-connect-tutorial/) is a good link for connecting to twitter using twitter4j. you will need to load the authorization url in webview so that you can open the login page in application.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top