原创 android學習3:Context
Context: Context描述應用程序環境上下文,它是一個抽象類,通過它可以獲取應用程序的資源和類,繼承關係如圖: 應用程序Context數目: Context實例 個數= Service實例個數 + Activity實例個數
原创 android學習2:Intent與Bundle
Intent: 1.Intent用來啓動系統組件(Activity,Service,BroadcastReceiver) 2.Intent的屬性 Component屬性:接受一個ComponentName對象,創建一個ComponentN
原创 使用TinyXML進行xml文件解析,生成xml文件
xml文件解析: void Load() {std::string filePath = "project.xml";TiXmlDocument* xmlDoc = new TiXmlDocument(filePath.c_str()
原创 9.osg中實現半透明效果:
在爲球貼圖的基礎上,實現模擬地球的透明展示。 是先前效果如下: 實現後效果如下: 實現代碼如下,主要是在狀態集中進行設置: osg::ref_ptr<osg::BlendFunc>blendFunc = new osg::BlendF
原创 android xml中layer-list shape 和 selector
轉自 http://blog.csdn.net/brokge/article/details/9713041 感覺很詳細 <shape>和<selector>在Android UI設計中經常用到。比如我們要自定義一個圓角Butto
原创 nginx uwsgi django supervisor 服務器配置
按照http://uwsgi-docs.readthedocs.io/en/latest/tutorials/Django_and_nginx.html 遇到了很多坑,總結下: 安裝需要的包 1: # sudo apt-get inst
原创 正則表達式的使用
記錄一下,說不定以後用到了呢 元字符: + 其前導字符必須在目標對象中連續出現一次或多次 * 其前導字符必須在目標對象中連續出現零次或多次 ? 其前導字符必須在目標對象中連續出現零次或一次 \s 用於匹配單個空格,包
原创 HandlerThread
HandlerThread is a thread with a message queue that incorporates a Thread, a Looper, and a MessageQueue. HandlerThread
原创 Effective Java 記錄
Item 1: Consider static factory methods instead of constructors advantage: 1 unlike constructors, they have names 2 th
原创 Android中Handler引起的內存泄露
原文地址:http://droidyue.com/blog/2014/12/28/in-android-handler-classes-should-be-static-or-leaks-might-occur/ 在Android常
原创 android自定義view繼承linearLayout,view大小大於屏幕
view定義了滑動功能,確始終只顯示屏幕大小,滑動後原來應該出現的部分爲空白,而在另一個基本一樣的自定義View中確正常顯示。 百思不得其解,setMeasuredDimension函數打印結果也是正確的,但就是顯示不出來。最後兩個自定義
原创 java中斷線程
轉http://www.cnblogs.com/simonshi/archive/2011/12/31/2308455.html 程序是很簡易的。然而,在編程人員面前,多線程呈現出了一組新的難題,如果沒有被恰當的解決,將導致意外的 行爲
原创 java Thread sleep yield join wait notify notifyAll
記錄一下: Thread States A thread can be only in one of five states (see Figure 9-2): New : This is the state the threa
原创 android 解決volley中StringRequest返回亂碼
繼承StringRequest類 重寫 /** 自定義request類 目的修改volley編碼爲utf-8 默認爲Latin1 中文顯示亂碼*/public static class Utf8StringRequest extends
原创 android中overridependingtransition方法使用
實現兩個 Activity 切換時的動畫。在Activity中使用 有兩個參數:進入動畫和出去的動畫。 注意 1、必須在 StartActivity() 或 finish() 之後立即調用。 2、而且在