package yifeiyuan.practice.practicedemos.intent; import android.content.Intent; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.View; import android.widget.TextView; import butterknife.ButterKnife; import butterknife.InjectView; import yifeiyuan.practice.practicedemos.R; public class AffinityActivityC extends AppCompatActivity { @InjectView(R.id.toolbar) Toolbar mToolbar; @InjectView(R.id.tv_c) TextView mTvC; @InjectView(R.id.fab) FloatingActionButton mFab; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_affinity_activity_c); ButterKnife.inject(this); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) .setAction("Action", null).show(); } }); mTvC.append(" TaskId:" + getTaskId()); mTvC.setOnClickListener(v -> startActivity(new Intent(AffinityActivityC.this, AffinityActivityD.class))); } }