Android Open Source - utwitterapi Pin Code Activity






From Project

Back to project page utwitterapi.

License

The source code is released under:

GNU General Public License

If you think the Android project utwitterapi 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 org.mariotaku.utwitterapi.activity;
/*from   w  w  w  . ja v a  2  s.  c o  m*/
import org.mariotaku.utwitterapi.R;

import android.app.Activity;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

public class PinCodeActivity extends Activity implements OnClickListener {

  private TextView mPinCodeView;
  private Button mCopyButton;
  private Button mOKButton;

  @Override
  public void onClick(final View v) {
    switch (v.getId()) {
      case R.id.copy: {
        final ClipboardManager cm = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
        cm.setPrimaryClip(ClipData.newPlainText(getString(R.string.pin_code), mPinCodeView.getText()));
        Toast.makeText(this, R.string.pin_code_copied, Toast.LENGTH_SHORT).show();
        break;
      }
      case R.id.ok: {
        setResult(RESULT_OK);
        finish();
        break;
      }
    }
  }

  @Override
  public void onContentChanged() {
    super.onContentChanged();
    mPinCodeView = (TextView) findViewById(R.id.pin_code);
    mCopyButton = (Button) findViewById(R.id.copy);
    mOKButton = (Button) findViewById(R.id.ok);
  }

  @Override
  protected void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    final Intent intent = getIntent();
    final CharSequence pinCode = intent.getStringExtra(Intent.EXTRA_TEXT);
    if (TextUtils.isEmpty(pinCode)) {
      finish();
      return;
    }
    setContentView(R.layout.activity_pin_code);
    mPinCodeView.setText(pinCode);
    mCopyButton.setOnClickListener(this);
    mOKButton.setOnClickListener(this);
  }

}




Java Source Code List

org.mariotaku.utwitterapi.Constants.java
org.mariotaku.utwitterapi.UTwitterAPIPlugin.java
org.mariotaku.utwitterapi.activity.BrowserSigninAgentActivity.java
org.mariotaku.utwitterapi.activity.PinCodeActivity.java
org.mariotaku.utwitterapi.activity.PluginSettingsActivity.java
org.mariotaku.utwitterapi.adapter.ApplicationsListAdapter.java
org.mariotaku.utwitterapi.fragment.AddApplicationDialogFragmnt.java
org.mariotaku.utwitterapi.fragment.EditAPIDialogFragment.java
org.mariotaku.utwitterapi.fragment.ProgressDialogFragment.java
org.mariotaku.utwitterapi.fragment.ProxiedClientsListFragment.java
org.mariotaku.utwitterapi.fragment.XposedNotAvailableDialogFragment.java
org.mariotaku.utwitterapi.hook.ApacheSSLSocketFactoryHook.java
org.mariotaku.utwitterapi.hook.HttpClientModifyRequestCallback.java
org.mariotaku.utwitterapi.hook.HttpsURLConnectionSetHostnameVerifierCallback.java
org.mariotaku.utwitterapi.hook.HttpsURLConnectionSetSSLSocketFactoryCallback.java
org.mariotaku.utwitterapi.hook.OkHttpClientModifyRequestCallback.java
org.mariotaku.utwitterapi.hook.SchemeGetSocketFactoryCallback.java
org.mariotaku.utwitterapi.hook.Twitter4JFixURLCallback.java
org.mariotaku.utwitterapi.hook.Twitter4JForceHttpsCallback.java
org.mariotaku.utwitterapi.hook.URLConnectionModifyRequestCallback.java
org.mariotaku.utwitterapi.loader.AbsApplicationsLoader.java
org.mariotaku.utwitterapi.loader.ApplicationsLoader.java
org.mariotaku.utwitterapi.loader.ProxiedApplicationsLoader.java
org.mariotaku.utwitterapi.util.AllowAllHostnameVerifierImpl.java
org.mariotaku.utwitterapi.util.OAuthPasswordAuthenticator.java
org.mariotaku.utwitterapi.util.TrustAllApacheSSLSocketFactory.java
org.mariotaku.utwitterapi.util.TrustAllSSLSocketFactory.java
org.mariotaku.utwitterapi.util.TrustAllX509TrustManager.java
org.mariotaku.utwitterapi.util.Utils.java
org.mariotaku.utwitterapi.util.XposedPluginUtils.java