Android Open Source - spotthestation Twitter Webview Activity






From Project

Back to project page spotthestation.

License

The source code is released under:

Apache License

If you think the Android project spotthestation listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 * Written by Eleanor Da Fonseca, Weixiong Cen, Harrison Black & Boris Feron
 *///from   w  w w .j  a  v  a  2  s.  co  m

package nasa.android.spotthestation;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class TwitterWebviewActivity extends Activity {
  private Intent mIntent;
  static final String TWITTER_CALLBACK_URL = "oauth://t4jsample";

  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_twitter_webview);
    mIntent = getIntent();
    String url = (String) mIntent.getExtras().get("URL");
    WebView webView = (WebView) findViewById(R.id.webview);
    webView.setWebViewClient(new WebViewClient() {
      @Override
      public boolean shouldOverrideUrlLoading(WebView view, String url) {
        if (url.contains(TWITTER_CALLBACK_URL)) {
          Uri uri = Uri.parse(url);
          String oauthVerifier = uri.getQueryParameter("oauth_verifier");
          mIntent.putExtra("oauth_verifier", oauthVerifier);
          setResult(RESULT_OK, mIntent);
          finish();
          return true;
        }
        return false;
      }
    });
    webView.loadUrl(url);
  }
}




Java Source Code List

Entities.NASAImageCommentTable.java
Entities.NASAImageCommentTable_.java
Entities.NASAImageTable.java
Entities.NASAImageTable_.java
Entities.NASARegistrationTable.java
Entities.NASARegistrationTable_.java
.ISSPollingApp.java
.NotificationMDB.java
Servlets.ImageDownloadServlet.java
Servlets.ImageUploadServlet.java
Servlets.MarkerDownloadServlet.java
Servlets.RegistrationServlet.java
Threads.HttpPollingThread.java
Utilities.ZoneCalculator.java
Utilities.ZoneCalculator.java
WebServices.NotificationService.java
nasa.android.spotthestation.CameraActivity.java
nasa.android.spotthestation.CameraPlusActivity.java
nasa.android.spotthestation.GCMIntentService.java
nasa.android.spotthestation.HelpActivity.java
nasa.android.spotthestation.ImageViewActivity.java
nasa.android.spotthestation.MapActivity.java
nasa.android.spotthestation.MyCompassView.java
nasa.android.spotthestation.TwitterActivity.java
nasa.android.spotthestation.TwitterWebviewActivity.java
nasa.android.spotthestation.UploadToNasaServerActivity.java
org.netbeans.rest.application.config.ApplicationConfig.java