android147 360 程序锁

<?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
android:layout_width="match_parent"
android:layout_height="60dip"
android:background="#8866ff00"
android:gravity="center"
android:text="程序锁"
android:textSize="24sp" /> <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="horizontal" > <TextView
android:id="@+id/tv_unlock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/tab_left_pressed"
android:gravity="center"
android:text="未加锁" /> <TextView
android:id="@+id/tv_lock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/tab_right_default"
android:gravity="center"
android:text="已加锁" />
</LinearLayout> <FrameLayout
android:id="@+id/fl_content"
android:layout_width="match_parent"
android:layout_height="match_parent" /> </LinearLayout>
package com.itheima.mobileguard.activities; import com.itheima.mobileguard.R;
import com.itheima.mobileguard.fragment.LockFragment;
import com.itheima.mobileguard.fragment.UnLockFragment; import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.FrameLayout;
import android.widget.TextView; public class AppLockActivity extends FragmentActivity implements
OnClickListener { private FrameLayout fl_content;
private TextView tv_unlock;
private TextView tv_lock;
private FragmentManager fragmentManager;
private UnLockFragment unLockFragment;
private LockFragment lockFragment; @Override
protected void onCreate(Bundle arg0) {
super.onCreate(arg0);
initUI();
} private void initUI() {
setContentView(R.layout.activity_app_lock); fl_content = (FrameLayout) findViewById(R.id.fl_content);
tv_unlock = (TextView) findViewById(R.id.tv_unlock);
tv_lock = (TextView) findViewById(R.id.tv_lock);
tv_unlock.setOnClickListener(this);
tv_lock.setOnClickListener(this);
//获取到fragment的管理者 fragmentManager = getSupportFragmentManager();
//开启事务
FragmentTransaction mTransaction = fragmentManager.beginTransaction();
unLockFragment = new UnLockFragment();
lockFragment = new LockFragment();
/**
* 替换界面
* 1 需要替换的界面的id
* 2具体指某一个fragment的对象
*/
mTransaction.replace(R.id.fl_content, unLockFragment).commit();
} @Override
public void onClick(View v) { FragmentTransaction ft = fragmentManager.beginTransaction();
switch (v.getId()) {
case R.id.tv_unlock:
//没有加锁
tv_unlock.setBackgroundResource(R.drawable.tab_left_pressed);
tv_lock.setBackgroundResource(R.drawable.tab_right_default); ft.replace(R.id.fl_content, lockFragment);
System.out.println("切换到lockFragment");
break; case R.id.tv_lock:
//没有加锁
tv_unlock.setBackgroundResource(R.drawable.tab_left_default);
tv_lock.setBackgroundResource(R.drawable.tab_right_pressed); ft.replace(R.id.fl_content, unLockFragment);
System.out.println("切换到unlockFragment");
break;
}
ft.commit();
}
}
android147 360 程序锁的更多相关文章
- android147 360 程序锁fragment
package com.itheima.mobileguard.fragment; import java.util.ArrayList; import java.util.List; import ...
- android149 360 程序锁输入密码
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android=&quo ...
- Android学习笔记_63_手机安全卫士知识点归纳(3)分享 程序锁 服务 进程管理 widget
1.分享: Intent shareIntent = new Intent(); shareIntent.setAction(Intent.ACTION_SEND); shareIntent.setT ...
- CAD调试时抛出“正试图在 os 加载程序锁内执行托管代码。不要尝试在 DllMain 或映像初始化函数内运行托管代码”异常的解决方法
这些天重装了电脑Win10系统,安装了CAD2012和VS2012,准备进行软件开发.在调试程序的时候,CAD没有进入界面就抛出 “正试图在 os 加载程序锁内执行托管代码.不要尝试在 DllMain ...
- 正尝试在 OS 加载程序锁内执行托管代码。不要尝试在 DllMain 或映像初始化函数内运行托管代码,这样...
出错提示: 正尝试在 OS 加载程序锁内执行托管代码.不要尝试在 DllMain 或映像初始化函数内运行托管代码,这样做会导致应用程序挂起. 原因分析: .NET2.0中增加了42种非常强大的调试助手 ...
- 检测到 LoaderLock:DLL"XXXX"正试图在OS加载程序锁内执行
解决方法: ctrl+D+E或alt+ctl+e或使用菜单调试——>异常——>异常窗口——>Managed Debugging Assistants——>去掉LoaderLoc ...
- 正试图在 os 加载程序锁内执行托管代码。不要尝试在 DllMain 或映像初始化函数内运行托管代码
来自:http://www.cnblogs.com/lcxu2/archive/2011/01/16/2004016.html 正试图在 os 加载程序锁内执行托管代码.不要尝试在 DllMain 或 ...
- Android安全问题 程序锁
导读:本文介绍如何实现对应用加锁的功能,无须root权限 某些人有时候会有这样一种需求,小A下载了个软件,只是软件中的美女过于诱惑与暴露,所以他不想让别人知道这是个什么软件,起码不想让别人打开浏 览. ...
- 正尝试在 OS 载入程序锁内执行托管代码。不要尝试在 DllMain 或映像初始化函数内执行托管代码,这样做会导致应用程序挂起。
出错提示: 正尝试在 OS 载入程序锁内执行托管代码. 不要尝试在 DllMain 或映像初始化函数内执行托管代码,这样做会导致应用程序挂起. 原因分析: .NET2.0中添加了42种非常强大的调试助 ...
随机推荐
- Java连接Oracle10g
1.导入驱动包: a.找到oracle安装目录下的jdbc/lib中的文件classes12.jar: b.右击你创建的JAVA工程,找到Build path,选择Add External Archi ...
- U盘安装Centos5.3
一.制作 U 盘启动引导盘 1. 插上 U 盘,打开 UltraISO 软件,打开CentOS-5.3-i386-bin-DVD.iso 文件: 2.点启动--写入硬盘镜像,在硬盘驱动器里面选择你的 ...
- bzoj1150
haha,贪心,边界条件折腾了我一会儿 #include<cstdio> #include<cctype> #include<queue> #include< ...
- [HIve - LanguageManual] Union
Union Syntax select_statement UNION ALL select_statement UNION ALL select_statement ... UNION is use ...
- [Hive - LanguageManual] Archiving for File Count Reduction
Archiving for File Count Reduction Note: Archiving should be considered an advanced command due to t ...
- C# 字符串格式
1.数字补零输出字符串 String.Format("{0:D6}",123); 2.字符串靠左输出6位 String.Format("{0,-6}",&quo ...
- numpy的矩阵运算
矩阵赋值 >>> x1=np.arange(0,5) # array([0, 1, 2, 3, 4]) >>> x2=np.arange(1,6) # array( ...
- 中文模糊搜索 - chunyu
什么是模糊搜索?为什么要使用模糊搜索?相信大家都知道这些,我就不讲了.今天只讲怎么使用模糊搜索. 一 LIKE.大名鼎鼎的like字句,使用方便,兼容性好,易维护,但效率奇低.大家都会用,不多介绍. ...
- 将大数据利用 BCP 导出SqlServer数据到CSV
--导出数据 --BCP [数据库]..[数据库表] out "d:\abc.csv" -c -t "|" -T bcp "SELECT * FROM ...
- 修改Map中确定key对应的value问题
今天在码代码的时候出现一个没有预料的问题: 先看下面的代码: public static void main(String[] args) { String[] files=new String[]{ ...