网友通过本文主要向大家介绍了手机安全卫士,360手机安全卫士,360手机安全卫士下载,360手机安全卫士官网,手机安全卫士排行榜等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
手机安全卫士——手机防盗页面,安全卫士防盗页面
LostFindActivity.java
public class LostFindActivity extends Activity { private SharedPreferences mPrefs; private TextView tvSafePhone; private ImageView ivProtect; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mPrefs = getSharedPreferences("config", MODE_PRIVATE); boolean configed = mPrefs.getBoolean("configed", false);// 判断是否进入过设置向导 if (configed) { setContentView(R.layout.activity_lost_find); // 根据sp更新安全号码 tvSafePhone = (TextView) findViewById(R.id.tv_safe_phone); String phone = mPrefs.getString("safe_phone", ""); tvSafePhone.setText(phone); // 根据sp更新保护锁 ivProtect = (ImageView) findViewById(R.id.iv_protect); boolean protect = mPrefs.getBoolean("protect", false); if (protect) { ivProtect.setImageResource(R.drawable.lock); } else { ivProtect.setImageResource(R.drawable.unlock); } } else { // 跳转设置向导页 startActivity(new Intent(this, Setup1Activity.class)); finish(); } } /** * 重新进入设置向导 * * @param view */ public void reEnter(View view) { startActivity(new Intent(this, Setup1Activity.class)); finish(); } }
activity_lost_find.xml
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <TextView style="@style/TitleStyle" android:text="手机防盗" /> <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="5dp" android:gravity="center_vertical" > <TextView style="@style/ContentStyle" android:text="安全号码" /> <TextView android:id="@+id/tv_safe_phone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_centerVertical="true" android:textColor="@color/black" android:textSize="16sp" /> </RelativeLayout> <ImageView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:background="@drawable/listview_divider" /> <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="5dp" android:gravity="center_vertical" > <TextView style="@style/ContentStyle" android:text="防盗保护是否开启" /> <ImageView android:id="@+id/iv_protect" android:layout_width="30dp" android:layout_height="30dp" android:layout_alignParentRight="true" android:layout_centerVertical="true" android:src="@drawable/unlock" /> </RelativeLayout> <ImageView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:background="@drawable/listview_divider" /> <TextView android:layout_width="match_parent" android:background="@drawable/shape_selector" android:onClick="reEnter" android:clickable="true" style="@style/ContentStyle" android:layout_margin="5dp" android:text="重新进入设置向导" /> <ImageView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:background="@drawable/listview_divider" /> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="功能简介" android:layout_margin="5dp" android:textColor="@color/black" android:textSize="18sp" android:background="#5000" /> <TextView style="@style/ContentStyle" android:drawableLeft="@android:drawable/star_big_on" android:gravity=