Back to project page pocket4android.
The source code is released under:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, includin...
If you think the Android project pocket4android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/* * Copyright (c) 2012-2014 Yu AOKI/*from ww w . j av a2 s . c om*/ * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ package com.aokyu.dev.pocket; import com.aokyu.dev.pocket.util.PocketUtils; import android.app.Activity; import android.content.Intent; import android.net.Uri; public abstract class AuthCallbackActivity extends Activity implements AuthorizationCallback { private ConsumerKey mConsumerKey; private RequestToken mRequestToken; public abstract void onAuthorizationFinished(RequestToken requestToken); @Override public void onRequested(ConsumerKey consumerKey, RequestToken requestToken) { mConsumerKey = consumerKey; mRequestToken = requestToken; } @Override public Activity onRequestContinued() { return this; } @Override protected void onNewIntent(Intent intent) { Uri uri = intent.getData(); if (uri != null) { String callbackUri = uri.toString(); if (callbackUri.startsWith(PocketUtils.getAppId(mConsumerKey))) { onAuthorizationFinished(mRequestToken); } } } }