Back to project page example.
The source code is released under:
Apache License
If you think the Android project example listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package me.pratama.examplematerial; // ww w.j a v a2s. com import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.ListView; import butterknife.ButterKnife; import butterknife.InjectView; import me.pratama.examplematerial.ui.FabActivity; import me.pratama.examplematerial.ui.RecyclerViewActivity; public class MainActivity extends BaseActivity implements AdapterView.OnItemClickListener { @InjectView(R.id.listview) ListView listView; private ArrayAdapter<String> adapter; private String[] listMenu = { "FAB (Floating Action Button)", "RecylerView" }; public static SharedPreferences settings; public static SharedPreferences.Editor editor; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ButterKnife.inject(this); getSupportActionBar().setTitle("MaterialDesignExample"); adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, listMenu); listView.setAdapter(adapter); listView.setOnItemClickListener(this); } @Override public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) { switch (i) { case 0: startActivity(new Intent(this, FabActivity.class)); break; case 1: startActivity(new Intent(this, RecyclerViewActivity.class)); break; } } }