- 浏览: 16858 次
最新评论
文章列表
LayoutInflater作用是将layout的xml布局文件实例化为View类对象。
获取LayoutInflater的方法有如下三种:
?
LayoutInflater inflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(R.layout.main, null);
LayoutInflater inflater = LayoutInflater.from(cont ...
- 2012-07-18 10:40
- 浏览 728
- 评论(0)
0
PPI是英文Pixels per inch的缩写,意思就是每英寸所拥有的像素(Pixel)数目,人眼所能看到的极限300ppi。PPI值越高,表示显示屏显示越清晰和细腻。
- 2012-07-02 16:30
- 浏览 744
- 评论(0)
/**
* 从网络上获取图片资源
* @param url
* @return
*/
public static Bitmap getHttpBitmap(String url){
URL myFileURL;
Bitmap bitmap=null;
try{
myFileURL = new URL(url);
//获得连接
HttpURLConnection conn=(HttpURLConnection)myFileURL.openConnection();
// ...
- 2012-06-25 16:54
- 浏览 1925
- 评论(0)
button1.setFocusableInTouchMode(true);
button1.requestFocus();
- 2012-06-25 09:36
- 浏览 1479
- 评论(0)
MainActivity.java //主入口类
package com.myviewgroup.chen;
import android.app.Activity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.widget.LinearLayout;
public class MainActivity extends Activity {private MyViewGroup viewGroup;private PageCont ...
- 2012-06-21 18:28
- 浏览 665
- 评论(0)
package com.forcetech.android.hotel;
import java.net.URL;
import android.app.Activity;
import android.content.Intent;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnPreparedListener;
import android.net.Uri;
import android.os.Bundle;
im ...
- 2012-06-11 09:42
- 浏览 1080
- 评论(0)
我们选择的是jdk1.6.0_30版本。安装文件名为jdk-6u30-linux-i586.bin.
1、复制jdk到安装目录
(1)假设jdk安装文件在桌面,我们指定的安装目录是:/usr/local/java 。可是系统安装后在/usr/local下并没有java目录,这需要我们去创建一个java ...
- 2012-06-05 11:32
- 浏览 699
- 评论(0)
Linux下Tomcat的安装
1.下载Tomcat
在下面的地址下载Tomcat的二进制版
http://mirrors.ccs.neu.edu/Apache/dist/jakarta/tomcat-4/binaries/
即下载文件
tomcat-4.1.18.tar.gz
2. 安装
首先解压缩
gunzip tomcat-4.1.18.tar.gz
tar -zxvf tomcat-4.1.18.tar
得到Tomcat的所有文件.然后把它拷贝到你要安装的位置,如
/opt/tomcat-4.1.18/
...
- 2012-06-02 17:17
- 浏览 695
- 评论(0)
10 个免费的 C/C++ 集成开发环境
113人收藏此新闻,我要收藏|新闻投递oschina发布于:
2012年05月23日 (50评)
集
- 2012-06-01 09:45
- 浏览 1622
- 评论(0)
By default Ubuntu Desktop OS comes with ssh clientpackage. It does not include ssh
server package which is needed to
access this machine.
To install SSH on the newly installed Ubuntu 12.04 run following commands
sudo apt-get update
sudo apt-get install ssh
sudo /etc/init.d/ssh restart
...
- 2012-05-19 08:30
- 浏览 826
- 评论(0)
public static void getMyToast(Context context , int imageResource , String content , int time){Toast toast = new Toast(context);toast.setDuration(time);//设置时间toast.setGravity(Gravity.CENTER, 0,25 ); // 设置出现的位置//自定义布局LinearLayout linearLayout = new LinearLayout(context);linearLayout.setOrientation(Lin ...
- 2012-04-06 03:55
- 浏览 830
- 评论(0)
WindowManager manager=getWindowManager();
int hight =manager.getDefaultDisplay().getHeight(); //屏幕的高度
int width=manager.getDefaultDisplay().getWidth(); //屏幕宽
Log.i("TAG","hight :"+hight+" width :"+width);
- 2012-04-06 03:12
- 浏览 766
- 评论(0)
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.google.bean"><class name=" ...
- 2012-03-02 15:26
- 浏览 588
- 评论(0)
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>&l ...
- 2012-03-02 15:25
- 浏览 616
- 评论(0)
package com.google.dto;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.cfg.Configuration;
public class HibernateSessionFactory {
private static String CONFIG_FILE_LOCATION = "/hibernate.cfg.xml";private static final ThreadLocal<Session& ...
- 2012-03-02 15:20
- 浏览 513
- 评论(0)