adsense

2011-11-28

[android] 上一頁 or 返回



public boolean onKeyDown(int keyCode, KeyEvent event) {
           // TODO Auto-generated method stub
    if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
                   //上一頁
                   return true;
           }
           return super.onKeyDown(keyCode, event);
   }


按下 返回键程序就關閉了
//關鍵的幾行
public void onClick(View v) {
                finish();//關鍵
            }
        });

2011-11-21

什麼是 OVF



光學觀景窗(Optical View Finder,OVF)
OVF內的影像是利用稜鏡或其他光學原理自主鏡頭中的進光折射成相

可參考
http://zh.wikipedia.org/zh-hant/%E6%95%B8%E4%BD%8D%E5%96%AE%E7%9C%BC%E7%9B%B8%E6%A9%9F

2011-11-17

[android] Tab在下面

xml的部分

<?xml version="1.0" encoding="utf-8"?>


<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tabhost"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">
        <RelativeLayout
                android:layout_width="fill_parent"
                android:layout_height="fill_parent">
                <!-- set the tab title attributes and set the title align the bottom -->
                <TabWidget
                        android:id="@android:id/tabs"
                        android:layout_alignParentBottom="true"
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content">
                </TabWidget>
                <!-- set the tab body attributes -->
                <FrameLayout
                        android:id="@android:id/tabcontent"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content">
                        <LinearLayout
                                android:id="@+id/tab1"
                                android:orientation="vertical"
                                android:layout_width="fill_parent"
                                android:layout_height="fill_parent"
                                android:paddingTop="20dip">
                                <ImageView
                                        android:layout_width="wrap_content"
                                        android:layout_height="wrap_content"
                                        android:layout_gravity="center"
                                        android:src="@drawable/home_normal"/>
                        </LinearLayout>
                        <LinearLayout
                                android:id="@+id/tab2"
                                android:orientation="vertical"
                                android:layout_width="fill_parent"
                                android:layout_height="fill_parent"
                                android:paddingTop="20dip">
                                <ImageView
                                        android:layout_width="wrap_content"
                                        android:layout_height="wrap_content"
                                        android:layout_gravity="center"
                                        android:src="@drawable/garbage_normal"/>
                                </LinearLayout>
                        <LinearLayout
                                android:id="@+id/tab3"
                                android:orientation="vertical"
                                android:layout_width="fill_parent"
                                android:layout_height="fill_parent"
                                android:paddingTop="20dip">
                                <ImageView
                                        android:layout_width="wrap_content"
                                        android:layout_height="wrap_content"
                                        android:layout_gravity="center"
                                        android:src="@drawable/help_normal"/>
                        </LinearLayout>
                </FrameLayout>
        </RelativeLayout>
</TabHost>

主程式
package test.c;

import android.app.Activity;
import android.os.Bundle;
import android.view.Gravity;
import android.widget.TabHost;
import android.widget.Toast;
import android.widget.TabHost.OnTabChangeListener;

public class test  extends Activity {
    /** Called when the activity is first created. */
public static TabHost tab_host;
private TabHost mTabHost = null;
//private TabWidget mTabWidget = null;  
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
      //tag開始
        TabHost host = (TabHost)findViewById(R.id.tabhost);
        host.setup();

        TabHost.TabSpec homeSpec = host.newTabSpec("Home");        //This param will be used as tabId.
        homeSpec.setIndicator(null,         //This param will diplay as title. 
        getResources().getDrawable(R.drawable.home_normal));
        homeSpec.setContent(R.id.tab1);
        host.addTab(homeSpec);

        TabHost.TabSpec garbageSpec = host.newTabSpec("Garbage");
        garbageSpec.setIndicator(null, getResources().getDrawable(R.drawable.garbage_normal));
        garbageSpec.setContent(R.id.tab2);
        host.addTab(garbageSpec);

        TabHost.TabSpec maybeSpec = host.newTabSpec("Help");
        maybeSpec.setIndicator(null, getResources().getDrawable(R.drawable.help_normal));
        maybeSpec.setContent(R.id.tab3);
        host.addTab(maybeSpec);

        host.setOnTabChangedListener(new OnTabChangeListener() {

        @Override
        public void onTabChanged(String tabId) {
        // TODO Auto-generated method stub
        Toast toast = Toast.makeText(test.this, tabId, Toast.LENGTH_SHORT);
        toast.setGravity(Gravity.CENTER_HORIZONTAL, 0, 50);
        toast.show();
        }
        });

//                 host.setCurrentTabByTag("Home");
        Toast toast = Toast.makeText(test.this, "Home", Toast.LENGTH_SHORT);
        toast.setGravity(Gravity.CENTER_HORIZONTAL, 0, 50);
        toast.show();
        }
        }
        //tag finish

小提醒  記得放入圖片到 layout ==>drawable
       
    


2011-11-14

[笑話]


案例一
A:看見我的相機包說你也要去台大拍照喔
B:恩是阿
A:我們也是 你用哪一台相機阿,能看一下嗎
B:喔 好沒問題
(打開包包:給他看我的7D+小小白IS)
A:疑你怎麼不用N家的 C家的相機不是比較低階嗎
B:會嗎(忍住)
A:你看我用N的D5100這台超好的
B:恩是阿 還不錯(忍忍忍)
A:而且阿7D因該是很久以前的機器了,現在不是已經出到600D嗎
B:是阿(無言.)..
A:你看之前電視CSI 裡面的警察 都是用這個牌子
忍不住了.........
B:你知道為啥嗎,因為他們拍的都是死人 顏色差點也無所謂啦
........
http://www.mobile01.com/topicdetail.php?f=244&t=2439962&p=1

案例二
小弟前陣子某場合遇到朋友
朋友說:喔~你這是5D喔,我朋友也用5D
不過他用了五六年了,一直都捨不得換
你也是捨不得換喔
小弟也只是笑笑說這是5D二代啦
http://www.mobile01.com/topicdetail.php?f=244&t=2439962&p=3#31889192

2011-11-08

[google+] 移除遊戲授權

因友人提問所以就順便寫了
左上角齒輪點一下  google+設定

點選帳戶總覽

找到安全性 --> 授權應用程式和網站

將不想要的程式--> 撤銷存取權限

end

2011-11-04

[隨筆] net send

發訊息給個別的電腦  or 群體



我的電腦右鍵  ==> 管理  ==> 服務及應用程式  ==>服務  ==>
Messenger  ==> 啟動類型  (自動)  ==>套用 ==> 啟動  ==>確定



個別送訊息  net send 172.19.225.20 "訊息"

群體  net send * "訊息"