Android TwitterException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android TwitterException class.

This code example shows how to use the following methods:
This code example shows how to use the following methods:
            GEO_ENABLED = getBoolean("geo_enabled", json);
            LANGUAGE = json.getString("language");
            ALWAYS_USE_HTTPS = getBoolean("always_use_https", json);
            DISCOVERABLE_BY_EMAIL = getBoolean("discoverable_by_email", json);
            TIMEZONE = new TimeZoneJSONImpl(json.getJSONObject("time_zone"));
            SCREEN_NAME = json.getString("screen_name");
        } catch (JSONException e) {
            throw new TwitterException(e);
        } 
    } 
 
    /*package*/ AccountSettingsJSONImpl(HttpResponse res, Configuration conf) throws TwitterException {
        this(res, res.asJSONObject());
        if (conf.isJSONStoreEnabled()) {
            DataObjectFactoryUtil.clearThreadLocalMap(); 
            DataObjectFactoryUtil.registerJSONObject(this, res.asJSONObject());
        } 
    } 
 
    /*package*/ AccountSettingsJSONImpl(JSONObject json) throws TwitterException {
6
CodeRank
This code example shows how to use the following methods:
            sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
        } 
        try { 
            return sdf.parse(dateString);
        } catch (ParseException pe) {
            throw new TwitterException("Unexpected date format(" + dateString + ") returned from twitter.com", pe);
        }finally { 
            try { 
                simpleDateFormats.put(sdf);
            } catch (InterruptedException ignore) {
                // the size of LinkedBlockingQueue is Integer.MAX by default. 
                // there is no need to concern about this situation 
            } 
        } 
    } 
 
    public static int getInt(String name, JSONObject json) {
        return getInt(getRawString(name, json));
    } 
 
5
CodeRank
This code example shows how to use the following methods:getMessage, getStatusCode
	 */ 
 
	Alert(TwitterException e, Activity ac)
	{ 
		ad = new AlertDialog.Builder(ac);
		ad.setTitle("Twitter " + e.getStatusCode());
		 
		if(e.getStatusCode() == 401)
		{ 
			ad.setMessage("You are not logged in!");
		} 
		else if(e.getStatusCode() == 400)
		{ 
			ad.setMessage("Bad request!");
		} 
		else if(e.getStatusCode() == 404)
		{ 
			ad.setMessage("Could not connect to twitter!");
		} 
		else 

5
CodeRank
This code example shows how to use the following methods:
	public long getTwitterId(Context context) throws TwitterException {
		SharedPreferences pref = PreferenceManager
				.getDefaultSharedPreferences(context);
		long twitterId = pref.getLong(TWITTERID, NOAUTHORIZATION_ID);
		if (twitterId == NOAUTHORIZATION_ID) {
			throw new TwitterException("No Authorization TwitterID");
		} 
		return twitterId;
	} 
 
	/** 
	 * Twitterに投稿するかどうかを返す 
	 *  
	 * @param context 
	 * @return 
	 */ 
	public boolean isPostTwitter(Context context) {
		SharedPreferences pref = PreferenceManager
				.getDefaultSharedPreferences(context);
		int post = pref.getInt(POSTTWITTER, 0);
3
CodeRank
This code example shows how to use the following methods:getStatusCode
			} catch (final TwitterException e) {
				runOnUiThread(new Runnable() {
 
					public void run() { 
						Toast.makeText(context,
								"Errror : " + e.getStatusCode(),
								Toast.LENGTH_LONG).show();
					} 
				}); 
 
			} 
			return null; 
		} 
 
		@Override 
		protected void onPostExecute(Void v) {
			progressDialog.dismiss();
		} 
	} 
 
3
CodeRank

Related Android TwitterException Questions & Answers:

Other Android TwitterException Examples

236:					this.startActivity(new Intent(Intent.ACTION_VIEW, Uri
237:							.parse(requestToken.getAuthenticationURL())));
238:				} catch (TwitterException e) {
239:					e.printStackTrace();
240:				}
-
287:					
288:					Log.d("Status", "> " + response.getText());
289:				} catch (TwitterException e) {
290:					// Error in updating status
291:					Log.d("Twitter Update Error", e.getMessage());

Read More

See Code Examples for Android TwitterException Methods: