Back to project page power-consumption-android.
The source code is released under:
Apache License
If you think the Android project power-consumption-android 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 com.wolfsoft.epower; /*from ww w.j a v a 2s.c o m*/ import android.app.ActionBar; import android.app.Activity; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.view.MenuItem; import android.view.View; public class Appliancetips extends Activity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.appliancetips); // get action bar ActionBar actionBar = getActionBar(); // Enabling Up / Back navigation actionBar.setDisplayHomeAsUpEnabled(true); } public void share1(View v) { Uri imageUri = Uri.parse("android.resource://com.wolfsoft.epower/drawable/tips31"); Intent intent = new Intent(Intent.ACTION_SEND); intent.setType("image/png"); intent.putExtra(Intent.EXTRA_STREAM, imageUri); startActivity(Intent.createChooser(intent , "Share")); } public void share2(View v) { Uri imageUri = Uri.parse("android.resource://com.wolfsoft.epower/drawable/tip32"); Intent intent = new Intent(Intent.ACTION_SEND); intent.setType("image/png"); intent.putExtra(Intent.EXTRA_STREAM, imageUri); startActivity(Intent.createChooser(intent , "Share")); } public void share3(View v) { Uri imageUri = Uri.parse("android.resource://com.wolfsoft.epower/drawable/tip33"); Intent intent = new Intent(Intent.ACTION_SEND); intent.setType("image/png"); intent.putExtra(Intent.EXTRA_STREAM, imageUri); startActivity(Intent.createChooser(intent , "Share")); } public void share4(View v) { Uri imageUri = Uri.parse("android.resource://com.wolfsoft.epower/drawable/tip34"); Intent intent = new Intent(Intent.ACTION_SEND); intent.setType("image/png"); intent.putExtra(Intent.EXTRA_STREAM, imageUri); startActivity(Intent.createChooser(intent , "Share")); } public void share5(View v) { Uri imageUri = Uri.parse("android.resource://com.wolfsoft.epower/drawable/tip35"); Intent intent = new Intent(Intent.ACTION_SEND); intent.setType("image/png"); intent.putExtra(Intent.EXTRA_STREAM, imageUri); startActivity(Intent.createChooser(intent , "Share")); } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: Intent intent = new Intent(this,Tips.class); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK); startActivity(intent); overridePendingTransition(R.anim.anim_slide_in_left, R.anim.anim_slide_out_right); default: return super.onOptionsItemSelected(item); } } }