Search in sources :

Example 76 with OnClickListener

use of android.view.View.OnClickListener in project coursera-android by aporter.

the class LoggingServiceClient method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    final Button buttonStart = (Button) findViewById(R.id.buttonStart);
    buttonStart.setOnClickListener(new OnClickListener() {

        public void onClick(View v) {
            if (mIsBound) {
                // Send Message to the Logging Service
                logMessageToService();
            }
        }
    });
}
Also used : Button(android.widget.Button) OnClickListener(android.view.View.OnClickListener) View(android.view.View)

Example 77 with OnClickListener

use of android.view.View.OnClickListener in project coursera-android by aporter.

the class SimpleThreadingExample method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    mImageView = (ImageView) findViewById(R.id.imageView);
    final Button button = (Button) findViewById(R.id.loadButton);
    button.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            loadIcon();
        }
    });
    final Button otherButton = (Button) findViewById(R.id.otherButton);
    otherButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            Toast.makeText(SimpleThreadingExample.this, "I'm Working", Toast.LENGTH_SHORT).show();
        }
    });
}
Also used : Button(android.widget.Button) OnClickListener(android.view.View.OnClickListener) ImageView(android.widget.ImageView) View(android.view.View)

Example 78 with OnClickListener

use of android.view.View.OnClickListener in project coursera-android by aporter.

the class SimpleThreadingViewPostActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    mImageView = (ImageView) findViewById(R.id.imageView);
    final Button button = (Button) findViewById(R.id.loadButton);
    button.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            loadIcon();
        }
    });
    final Button otherButton = (Button) findViewById(R.id.otherButton);
    otherButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            Toast.makeText(SimpleThreadingViewPostActivity.this, "I'm Working", Toast.LENGTH_SHORT).show();
        }
    });
}
Also used : Button(android.widget.Button) OnClickListener(android.view.View.OnClickListener) ImageView(android.widget.ImageView) View(android.view.View)

Example 79 with OnClickListener

use of android.view.View.OnClickListener in project box-android-apptoapp-sdk by box.

the class ZipActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.zip);
    if (getIntent().getParcelableExtra(EXTRA_ONE_CLOUD_DATA) == null) {
        finish();
        return;
    }
    // The OneCloud object is what we want to keep track of in our app. It is parcelable so it is easily transferred between activities, receivers, etc.
    ocd = (OneCloudData) getIntent().getParcelableExtra(EXTRA_ONE_CLOUD_DATA);
    TextView txtFileName = (TextView) findViewById(R.id.txtFileName);
    txtFileName.setText(ocd.getFileName());
    Button btnZip = (Button) findViewById(R.id.btnZip);
    btnZip.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            doZip();
        }
    });
}
Also used : Button(android.widget.Button) OnClickListener(android.view.View.OnClickListener) TextView(android.widget.TextView) TextView(android.widget.TextView) View(android.view.View)

Example 80 with OnClickListener

use of android.view.View.OnClickListener in project FirebaseUI-Android by firebase.

the class WelcomeBackIdpPrompt method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.welcome_back_idp_prompt_layout);
    IdpResponse newUserIdpResponse = IdpResponse.fromResultIntent(getIntent());
    mPrevCredential = AuthCredentialHelper.getAuthCredential(newUserIdpResponse);
    User oldUser = User.getUser(getIntent());
    String providerId = oldUser.getProvider();
    for (IdpConfig idpConfig : mActivityHelper.getFlowParams().providerInfo) {
        if (providerId.equals(idpConfig.getProviderId())) {
            switch(providerId) {
                case GoogleAuthProvider.PROVIDER_ID:
                    mIdpProvider = new GoogleProvider(this, idpConfig, oldUser.getEmail());
                    break;
                case FacebookAuthProvider.PROVIDER_ID:
                    mIdpProvider = new FacebookProvider(this, idpConfig, mActivityHelper.getFlowParams().themeId);
                    break;
                case TwitterAuthProvider.PROVIDER_ID:
                    mIdpProvider = new TwitterProvider(this);
                    break;
                default:
                    Log.w(TAG, "Unknown provider: " + providerId);
                    finish(ResultCodes.CANCELED, IdpResponse.getErrorCodeIntent(ErrorCodes.UNKNOWN_ERROR));
                    return;
            }
        }
    }
    if (mIdpProvider == null) {
        Log.w(TAG, "Firebase login unsuccessful." + " Account linking failed due to provider not enabled by application: " + providerId);
        finish(ResultCodes.CANCELED, IdpResponse.getErrorCodeIntent(ErrorCodes.UNKNOWN_ERROR));
        return;
    }
    ((TextView) findViewById(R.id.welcome_back_idp_prompt)).setText(getIdpPromptString(oldUser.getEmail()));
    mIdpProvider.setAuthenticationCallback(this);
    findViewById(R.id.welcome_back_idp_button).setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View view) {
            mActivityHelper.showLoadingDialog(R.string.progress_dialog_signing_in);
            mIdpProvider.startLogin(WelcomeBackIdpPrompt.this);
        }
    });
}
Also used : IdpConfig(com.firebase.ui.auth.AuthUI.IdpConfig) TwitterProvider(com.firebase.ui.auth.provider.TwitterProvider) FirebaseUser(com.google.firebase.auth.FirebaseUser) User(com.firebase.ui.auth.ui.User) OnClickListener(android.view.View.OnClickListener) TextView(android.widget.TextView) GoogleProvider(com.firebase.ui.auth.provider.GoogleProvider) View(android.view.View) TextView(android.widget.TextView) IdpResponse(com.firebase.ui.auth.IdpResponse) FacebookProvider(com.firebase.ui.auth.provider.FacebookProvider)

Aggregations

OnClickListener (android.view.View.OnClickListener)794 View (android.view.View)792 TextView (android.widget.TextView)492 Button (android.widget.Button)265 ImageView (android.widget.ImageView)256 Intent (android.content.Intent)183 ListView (android.widget.ListView)112 AdapterView (android.widget.AdapterView)91 ScrollView (android.widget.ScrollView)52 LinearLayout (android.widget.LinearLayout)49 Bundle (android.os.Bundle)43 LayoutInflater (android.view.LayoutInflater)35 ViewGroup (android.view.ViewGroup)30 ArrayList (java.util.ArrayList)30 BindView (butterknife.BindView)29 KeyEvent (android.view.KeyEvent)28 EditText (android.widget.EditText)28 DialogInterface (android.content.DialogInterface)27 OnItemClickListener (android.widget.AdapterView.OnItemClickListener)25 FragmentManager (android.support.v4.app.FragmentManager)23