当前位置: 编程技术>移动开发
本页文章导读:
▪Activity(1) Activity(一)
How to start an Intent?
Intent intent = new Intent(this, SignInActivity.class);
startActivity(intent);
Intent Intent = new Intent();
Intent.setComponent(new ComponentName(pkgName, activityName));
Intent Intent = new Intent();
Intent.se.........
▪ 升级Xcode失败的解决办法 升级Xcode失败的解决方法
以前一直用的Xcode 3.2.5,现在准备升级到Xcode 4.3.1,在官网上下载了Xcode 4.3.1的安装包,公司电脑的系统是Lion 10.7.3,安装一切顺利,回到家后,同样的安装包,同样.........
▪ fedora之ssh配备 fedora之ssh配置
1) 安装openssh-server[root@localhost ~]# yum install openssh-server2) 查看是否已成功安装openssh-server[root@localhost ~]# rpm -qa | grep openssh-serveropenssh-server-5.3p1-19.fc12.i686[root@localhost ~]#3) 修改ssh.........
[1]Activity(1)
来源: 互联网 发布时间: 2014-02-18
Activity(一)
How to start an Intent?
Saving activity state
There's no guarantee that onSaveInstanceState() will be called before your activity is destroyed, If the system calls onSaveInstanceState(), it does so before onStop() and possibly before onPause().
Because the default implementation of onSaveInstanceState() helps save the state of the UI, if you override the method in order to save additional state information, you should always call the superclass implementation of onSaveInstanceState() before doing any work. Likewise, you should also call the supercall implementation of onRestoreInstanceState() if you override it, so the default implementation can restore view states.
A good way to test your application's ability to restore its state is to simply rotate the device so that the screen orientation changes.
How to start an Intent?
Intent intent = new Intent(this, SignInActivity.class); startActivity(intent);
Intent Intent = new Intent(); Intent.setComponent(new ComponentName(pkgName, activityName));
Intent Intent = new Intent(); Intent.setClassName(String pkgName, String activityName);
//Activity Send Intent intent = new Intent(Intent.ACTION_SEND); Intent.addCategory(Intent.CATEGORY_LAUNCHER); intent.putExtra("apkpath", "/mnt/sdcard/apkinstall"); startActivity(intent); //Activity Receive Intent intent = getIntent(); intent.hasExra("apkpath"); String recevieValue = intent.getStringExtra("apkpath"); File file = new File(recevieValue); if(file.exists()){ Toast.makeText(this, "OK", Toast.LENGTH_SHORT).show(); }
//Send static final private int GET_CODE = 0; startActivityForResult(intent, GET_CODE); @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == GET_CODE){ if (resultCode == RESULT_CANCELED){} else {System.out.println("data.getData() " + data.getAction());} } } //Receive setResult(RESULT_OK, (new Intent()).setAction("Corky!"));
Saving activity state
There's no guarantee that onSaveInstanceState() will be called before your activity is destroyed, If the system calls onSaveInstanceState(), it does so before onStop() and possibly before onPause().
Because the default implementation of onSaveInstanceState() helps save the state of the UI, if you override the method in order to save additional state information, you should always call the superclass implementation of onSaveInstanceState() before doing any work. Likewise, you should also call the supercall implementation of onRestoreInstanceState() if you override it, so the default implementation can restore view states.
A good way to test your application's ability to restore its state is to simply rotate the device so that the screen orientation changes.
[2] 升级Xcode失败的解决办法
来源: 互联网 发布时间: 2014-02-18
升级Xcode失败的解决方法
以前一直用的Xcode 3.2.5,现在准备升级到Xcode 4.3.1,在官网上下载了Xcode 4.3.1的安装包,公司电脑的系统是Lion 10.7.3,安装一切顺利,回到家后,同样的安装包,同样的系统,安装报错,提示必须先安装Mobile Device Framework。
双击安装包,出来下面的界面:
右键显示包内容,然后按照下面的路径找到MobileDevice.pkg,双击安装即可:Contents->Resources->Packages->MobileDevice.pkg
或者到官网下载xcode_432_lion.dmg,直接安装即可。
最简单的方法:直接在App Store里进行安装。
[3] fedora之ssh配备
来源: 互联网 发布时间: 2014-02-18
fedora之ssh配置
1) 安装openssh-server
[root@localhost ~]# yum install openssh-server
2) 查看是否已成功安装openssh-server
[root@localhost ~]# rpm -qa | grep openssh-server
openssh-server-5.3p1-19.fc12.i686
[root@localhost ~]#
3) 修改ssh服务的配置文件
配置ssh服务的运行参数, 是通过修改配置文件/etc/ssh/ssh_config实现的. /etc/ssh/ssh_config文件的配置选项非常多, 但大部分都已经用"#"注释掉了.
#Port 22
#Protocol 2,1
配置完保存配置文件, 不过如果没什么特殊的要求这都不用配置.
4) 重启SSH服务
[root@localhost ~]# /etc/rc.d/init.d/sshd restart
可能没有
service sshd restart
ssh localhost
Stopping sshd: [ OK ]
Starting sshd: [ OK ]
5) 如果开启了防火墙, 我们需要允许TCP协议的22端口通过.
[root@localhost ~]# iptables -I INPUT -p tcp --dport 22 -j ACCEPT
6) 如果想让ssh服务开机就运行, 需要使用# ntsysv命令打开开机服务选项卡. 选中sshd后按"OK".
[root@localhost ~]# ntsysv
为了开机启动打开
vim /etc/profile
最后一行
/sbin/service sshd start
/sbin/iptables -I INPUT -p tcp --dport 22 -j ACCEPT
7) 到这里所有工作都完成了, 可以尝试从客户端SSH登陆Fedora. 我用的是PUTTY, 一款非常好用的软件, 支持Telnet, SSH
-------------yum---------
http://mirrors.163.com/.help/fedora.html
代理
http://www.cnblogs.com/ncturtle/archive/2011/11/24/2262051.html
每行加
proxy=http://web-proxy.什么什么.com:8080
office2007破解
http://wenku.baidu.com/view/a0973911cc7931b765ce15eb.html
wget也需要代理
vim .wgetrc
http-proxy=web-proxy.什么什么.com:8080
ftp-proxy=web-proxy.什么什么.com:8080
1) 安装openssh-server
[root@localhost ~]# yum install openssh-server
2) 查看是否已成功安装openssh-server
[root@localhost ~]# rpm -qa | grep openssh-server
openssh-server-5.3p1-19.fc12.i686
[root@localhost ~]#
3) 修改ssh服务的配置文件
配置ssh服务的运行参数, 是通过修改配置文件/etc/ssh/ssh_config实现的. /etc/ssh/ssh_config文件的配置选项非常多, 但大部分都已经用"#"注释掉了.
#Port 22
#Protocol 2,1
配置完保存配置文件, 不过如果没什么特殊的要求这都不用配置.
4) 重启SSH服务
[root@localhost ~]# /etc/rc.d/init.d/sshd restart
可能没有
service sshd restart
ssh localhost
Stopping sshd: [ OK ]
Starting sshd: [ OK ]
5) 如果开启了防火墙, 我们需要允许TCP协议的22端口通过.
[root@localhost ~]# iptables -I INPUT -p tcp --dport 22 -j ACCEPT
6) 如果想让ssh服务开机就运行, 需要使用# ntsysv命令打开开机服务选项卡. 选中sshd后按"OK".
[root@localhost ~]# ntsysv
为了开机启动打开
vim /etc/profile
最后一行
/sbin/service sshd start
/sbin/iptables -I INPUT -p tcp --dport 22 -j ACCEPT
7) 到这里所有工作都完成了, 可以尝试从客户端SSH登陆Fedora. 我用的是PUTTY, 一款非常好用的软件, 支持Telnet, SSH
-------------yum---------
http://mirrors.163.com/.help/fedora.html
代理
http://www.cnblogs.com/ncturtle/archive/2011/11/24/2262051.html
每行加
proxy=http://web-proxy.什么什么.com:8080
office2007破解
http://wenku.baidu.com/view/a0973911cc7931b765ce15eb.html
wget也需要代理
vim .wgetrc
http-proxy=web-proxy.什么什么.com:8080
ftp-proxy=web-proxy.什么什么.com:8080
最新技术文章: