Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6180511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:51:18+00:00 2026-05-24T00:51:18+00:00

I recently wrote up a simple Twitter app for Android to learn the ropes

  • 0

I recently wrote up a simple Twitter app for Android to learn the ropes of the Twitter API and OAuth.

The app’s main activity simply asks for a username to follow. It then calls another activity which handles the OAuth & Twitter API calls. It redirects the user to an authorization page, which then returns to the app after the user finishes.

It used to work just fine, but now for some reason when I call webview.loadUrl(authorizationURL), NOTHING happens. I never changed anything that would affect the WebView stuff though… Here’s my code:

@Override
public void onResume() {
    super.onResume();
    try {

        if(weNeedCredentials()) {
            obtainCredentials();
        }

        follow(mUsername);

    } catch (OAuthException oae) {
        // omitted
    }
}


private boolean weNeedCredentials() {
    // assume the method returns true
}


private void obtainCredentials() {
    final Token requestToken = mOauthService.getRequestToken();
    String authUrl = mOauthService.getAuthorizationUrl(requestToken);
    // I verified that authUrl is the correct url (and != null)

    final WebView oauthView = (WebView) findViewById(R.id.oauthview);

    oauthView.setWebViewClient(new WebViewClient() {
        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            if(someCondition) {
                oauthView.setVisibility(View.GONE);

                doOtherStuff();

                return true;
            }
            return super.shouldOverrideUrlLoading(view, url);
        }
    });

    oauthView.getSettings().setJavaScriptEnabled(true);
    oauthView.loadUrl(authUrl);

}

Here’s my layout xml file:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical">

    <WebView 
        android:id="@+id/oauthview"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
    />

</LinearLayout>

and also I included the proper Internet permissions in the Manifest.

A WebViewCoreThread is running for the life of the app, and a WebViewWorkerThread pops in later, but no WebView ever comes up (not even a white screen). The app never blocks either. It continues running as if the loadUrl() line were simply commented out.

I’ve tested on my phone (Droid X2) as well as an emulator, both with the same results. Any help would be greatly appreciated.

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T00:51:19+00:00Added an answer on May 24, 2026 at 12:51 am

    It continues running as if the loadUrl() line were simply commented out.

    It will always “continue running as if the loadUrl() line were simply commented out”. loadUrl() is asynchronous and does not block.

    Off the cuff, either:

    • weNeedCredentials() is returning false, or
    • follow() is replacing the UI, or
    • Twitter is doing a redirect, and someCondition is true, so you are making the WebView be GONE right away
    • there are issues with the URL that you are loading
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently wrote a program that used a simple producer/consumer pattern. It initially had
I recently wrote a simple bootloader in assembly for floppy disk booting. I used
Hey, I recently wrote this fairly simple game of life in JavaScript. Within this
I have been looking at Reflection.Emit recently. I wrote a simple program that generates
I recently wrote a simple utility in Perl to count words in a file
I recently wrote an iPad app that I would like to make a universal
I've been playing with OpenCL recently, and I'm able to write simple kernels that
I recently wrote a parser in Python using Ply (it's a python reimplementation of
I recently wrote a DLL in C# (.Net 2.0) which contains a class that
I recently wrote a class for an assignment in which I had to store

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.