当前位置:  编程技术>移动开发
本页文章导读:
    ▪"文件类型——MIME部类"的匹配表        "文件类型——MIME类型"的匹配表 //{后缀名, MIME类型} {".3gp", "video/3gpp"}, {".apk", "application/vnd.android.package-archive"}, {".asf", "video/x-ms-asf"}, {".avi", "video/x-msvideo"}, {".bin", "application/octet-stream"}, {.........
    ▪ 增多tab提示效果        增加tab提示效果 先说一下需求,我有多个tab页,每个tab也有新数据时我要动态提示是那个tab页收到了新数据。我采用的继承TabActivity然后用.addTab(myTabhost.newTabSpec("Sex")// make a new Tab.setIndicato.........
    ▪ 比较两个NSDate的间距       比较两个NSDate的间隔 [[NSDate date] timeIntervalSinceDate:preLocationDate] > 60.0f  NSTimeInterval返回的是一个double值,单位是秒   ......

[1]"文件类型——MIME部类"的匹配表
    来源: 互联网  发布时间: 2014-02-18
"文件类型——MIME类型"的匹配表

//{后缀名, MIME类型}

{".3gp", "video/3gpp"},

{".apk", "application/vnd.android.package-archive"},

{".asf", "video/x-ms-asf"},

{".avi", "video/x-msvideo"},

{".bin", "application/octet-stream"},

{".bmp",   "image/bmp"},

{".c", "text/plain"},

{".class", "application/octet-stream"},

{".conf", "text/plain"},

{".cpp", "text/plain"},

{".doc", "application/msword"},

{".exe", "application/octet-stream"},

{".gif", "image/gif"},

{".gtar", "application/x-gtar"},

{".gz", "application/x-gzip"},

{".h", "text/plain"},

{".htm", "text/html"},

{".html", "text/html"},

{".jar", "application/java-archive"},

{".java", "text/plain"},

{".jpeg", "image/jpeg"},

{".jpg", "image/jpeg"},

{".js", "application/x-javascript"},

{".log", "text/plain"},

{".m3u", "audio/x-mpegurl"},

{".m4a", "audio/mp4a-latm"},

{".m4b", "audio/mp4a-latm"},

{".m4p", "audio/mp4a-latm"},

{".m4u", "video/vnd.mpegurl"},

{".m4v", "video/x-m4v"},

{".mov", "video/quicktime"},

{".mp2", "audio/x-mpeg"},

{".mp3", "audio/x-mpeg"},

{".mp4", "video/mp4"},

{".mpc", "application/vnd.mpohun.certificate"},

{".mpe", "video/mpeg"},

{".mpeg", "video/mpeg"},

{".mpg", "video/mpeg"},

{".mpg4", "video/mp4"},

{".mpga", "audio/mpeg"},

{".msg", "application/vnd.ms-outlook"},

{".ogg", "audio/ogg"},

{".pdf", "application/pdf"},

{".png", "image/png"},

{".pps", "application/vnd.ms-powerpoint"},

{".ppt", "application/vnd.ms-powerpoint"},

{".prop", "text/plain"},

{".rar", "application/x-rar-compressed"},

{".rc", "text/plain"},

{".rmvb", "audio/x-pn-realaudio"},

{".rtf", "application/rtf"},

{".sh", "text/plain"},

{".tar", "application/x-tar"},

{".tgz", "application/x-compressed"}, 

{".txt", "text/plain"},

{".wav", "audio/x-wav"},

{".wma", "audio/x-ms-wma"},

{".wmv", "audio/x-ms-wmv"},

{".wps", "application/vnd.ms-works"},

//{".xml", "text/xml"},

{".xml", "text/plain"},

{".z", "application/x-compress"},

{".zip", "application/zip"},

{"", "*/*"}

 


    
[2] 增多tab提示效果
    来源: 互联网  发布时间: 2014-02-18
增加tab提示效果
先说一下需求,我有多个tab页,每个tab也有新数据时我要动态提示是那个tab页收到了新数据。
我采用的继承TabActivity然后用
.addTab(myTabhost.newTabSpec("Sex")// make a new Tab
.setIndicator("首页",getResources().getDrawable(R.drawable.a_1))
// set the Title and Icon
.setContent(new Intent(this,HomeActivity.class)));
然后我采用的是线程来控制,改变tab页text的颜色
private TabHost myTabhost;
private final int START=1;
private Message msg;
private TextView tv;
new Thread(new Runnable() {
        @Override
            public void run() {
            while(true){
              try {
                    msg = Message.obtain();
                     msg.what = 1;
                     handler.sendMessage(msg);
                           Thread.sleep(500);
//不停切换
                    } catch (InterruptedException e) {
                }
            }
            }
        }).start();
private final Handler handler = new Handler() {

public void handleMessage(Message msg) {
super.handleMessage(msg);

switch (msg.what) {
case START:
TabHost host=getTabHost();
TabWidget  widget=host.getTabWidget();
  tv = (TextView) widget.getChildAt(2).findViewById(android.R.id.title);//这儿getChildAt(2)是选择的第三个tab页进行提示,这儿可以动态给值
String r=decToHex((int)Math.floor(Math.random()*256)-1);
String g=decToHex((int)Math.floor(Math.random()*256)-1);
String b=decToHex((int)Math.floor(Math.random()*256)-1);
  tv.setTextColor(Color.parseColor("#"+r+g+b));
break;
}
}

};
public String decToHex(int dec)   
{   
String hexStr = "0123456789ABCDEF";   
int low = Math.abs(dec % 16);   
int high = Math.abs((dec - low)/16);   
String hex = "" + (hexStr.length()>high?hexStr.charAt(high):hexStr.charAt(0)) + (hexStr.length()>low?hexStr.charAt(low):hexStr.charAt(10));   
return hex;   
}

    
[3] 比较两个NSDate的间距
    来源: 互联网  发布时间: 2014-02-18
比较两个NSDate的间隔

[[NSDate date] timeIntervalSinceDate:preLocationDate] > 60.0f
 NSTimeInterval返回的是一个double值,单位是秒

 


    
最新技术文章:
▪Android开发之登录验证实例教程
▪Android开发之注册登录方法示例
▪Android获取手机SIM卡运营商信息的方法
网络技术 iis7站长之家
▪Android发送短信功能代码
▪Android根据电话号码获得联系人头像实例代码
▪Android中GPS定位的用法实例
▪Android实现退出时关闭所有Activity的方法
▪Android实现文件的分割和组装
▪Android录音应用实例教程
▪Android双击返回键退出程序的实现方法
▪Android实现侦听电池状态显示、电量及充电动...
▪Android获取当前已连接的wifi信号强度的方法
▪Android实现动态显示或隐藏密码输入框的内容
▪根据USER-AGENT判断手机类型并跳转到相应的app...
▪Android Touch事件分发过程详解
▪Android中实现为TextView添加多个可点击的文本
▪Android程序设计之AIDL实例详解
▪Android显式启动与隐式启动Activity的区别介绍
▪Android按钮单击事件的四种常用写法总结
▪Android消息处理机制Looper和Handler详解
▪Android实现Back功能代码片段总结
▪Android实用的代码片段 常用代码总结
▪Android实现弹出键盘的方法
▪Android中通过view方式获取当前Activity的屏幕截...
▪Android提高之自定义Menu(TabMenu)实现方法
▪Android提高之多方向抽屉实现方法
▪Android提高之MediaPlayer播放网络音频的实现方法...
▪Android提高之MediaPlayer播放网络视频的实现方法...
▪Android提高之手游转电视游戏的模拟操控
 


站内导航:


特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

©2012-2021,,E-mail:www_#163.com(请将#改为@)

浙ICP备11055608号-3