Back to project page EnterpriseShow.
The source code is released under:
This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a co...
If you think the Android project EnterpriseShow 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.ruixinyuan.producttrainingfinal; //from ww w . j a v a 2 s .c o m import android.content.Intent; import android.content.SharedPreferences; import android.content.SharedPreferences.OnSharedPreferenceChangeListener; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Bundle; import android.preference.ListPreference; import android.preference.Preference; import android.preference.Preference.OnPreferenceClickListener; import android.preference.PreferenceActivity; import android.preference.PreferenceManager; import android.widget.TextView; import android.widget.Toast; /* *@user vicentliu *@time 2013-6-9????4:04:41 *@package com.ruixinyuan.producttrainingfinal */ public class TabActivityFour extends PreferenceActivity implements OnSharedPreferenceChangeListener { ListPreference lp; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.setting_preference); Drawable d = getResources().getDrawable(R.drawable.divider); getListView().setDividerHeight(1); getListView().setDivider(d); getListView().setSelector(new ColorDrawable(Color.TRANSPARENT)); initPreferenceItem(); SharedPreferences prefs = PreferenceManager .getDefaultSharedPreferences(this); prefs.registerOnSharedPreferenceChangeListener(this); lp = (ListPreference)findPreference(getString(R.string.download_picture_way)); } private void initPreferenceItem () { findPreference(getString(R.string.app_recommend)) .setOnPreferenceClickListener(new OnPreferenceClickListener() { public boolean onPreferenceClick(Preference preference) { Toast.makeText(TabActivityFour.this, "??app????", 200).show(); return false; } }); findPreference(getString(R.string.recommend_to_friend)) .setOnPreferenceClickListener(new OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference preference) { Toast.makeText(TabActivityFour.this, "?????????", 200).show(); return false; } }); findPreference(getString(R.string.feedback)) .setOnPreferenceClickListener(new OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference preference) { Toast.makeText(TabActivityFour.this, "????????", 200).show(); return false; } }); findPreference(getString(R.string.update)) .setOnPreferenceClickListener(new OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference preference) { Toast.makeText(TabActivityFour.this, "????", 200).show(); return false; } }); findPreference(getString(R.string.help)) .setOnPreferenceClickListener(new OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference preference) { Toast.makeText(TabActivityFour.this, "???????????????", 200).show(); return false; } }); findPreference(getString(R.string.company_info)) .setOnPreferenceClickListener(new OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference preference) { Toast.makeText(TabActivityFour.this, "?????????????????????????????????~", 200).show(); return false; } }); findPreference(getString(R.string.telephone)) .setOnPreferenceClickListener(new OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference preference) { Toast.makeText(TabActivityFour.this, "???????", 200).show(); TextView tvTelephone = (TextView)findViewById(R.id.setting_textView_telephone_num); String str = tvTelephone.getText().toString(); Intent phoneCallIntent = new Intent("android.intent.action.CALL", Uri.parse("tel:" + str)); startActivity(phoneCallIntent); return false; } }); } @Override public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { if (key == getString(R.string.download_picture_way)) { Intent intent = new Intent(getString(R.string.connectivity_action)); sendBroadcast(intent); } } }