All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.example.timber.ui.DemoActivity Maven / Gradle / Ivy

The newest version!
package com.example.timber.ui;

import android.app.Activity;
import android.os.Bundle;
import android.widget.Button;
import android.widget.Toast;
import butterknife.OnClick;
import butterknife.Views;
import com.example.timber.R;
import timber.log.Timber;

import static android.widget.Toast.LENGTH_SHORT;

public class DemoActivity extends Activity {
  @Override protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.demo_activity);
    Views.inject(this);
    Timber.tag("LifeCycles");
    Timber.d("Activity Created");
  }

  @OnClick({ R.id.hello, R.id.hey, R.id.hi })
  public void greetingClicked(Button button) {
    Timber.i("A button with ID %s was clicked to say '%s'.", button.getId(), button.getText());
    Toast.makeText(this, "Check logcat for a greeting!", LENGTH_SHORT).show();
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy