Android Open Source - ItsTwitterTime Get User Task






From Project

Back to project page ItsTwitterTime.

License

The source code is released under:

Copyright (c) 2014, Saghm Rossi All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * ...

If you think the Android project ItsTwitterTime 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

package me.saghm.itstwittertime;
//from   w w  w  . j  a  va 2s . c om
import android.content.Intent;
import android.net.Uri;
import android.os.AsyncTask;
import android.util.Log;

import twitter4j.TwitterException;
import twitter4j.auth.RequestToken;

/**
 * Created by saghm on 9/21/14.
 */
public class GetUserTask extends AsyncTask<Start, Void, Void> {
    protected Void doInBackground(Start...s) {
        try {
            final Start start = s[0];
            start.twitter.setOAuthAccessToken(s[0].accessToken);
            final String user = s[0].twitter.getScreenName();

            start.runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    start.textView.setText("Logged in as " + user);
                }
            });
        } catch(Exception e) {
            Log.i("exception", ExceptionParser.parse(e));
        }

        return null;
    }
}




Java Source Code List

me.saghm.itstwittertime.ApplicationTest.java
me.saghm.itstwittertime.AuthTask.java
me.saghm.itstwittertime.Connector.java
me.saghm.itstwittertime.ExceptionParser.java
me.saghm.itstwittertime.GetUserTask.java
me.saghm.itstwittertime.LoginTask.java
me.saghm.itstwittertime.Start.java
me.saghm.itstwittertime.Start.java
me.saghm.itstwittertime.Tweet.java