原创 在分線程更新主線程的Ui界面方法

 我們經常會在後臺線程中去做一些耗時的操作,比如去網絡取數據。但是當數據取回來,需要顯示到頁面上的時候,會遇到一些小麻煩,因爲我們都知道,android的UI頁面是不允許在其他線程直接操作的。下面總結4中方法用來在線程中操作UI界面。方法

原创 佈局全屬性

佈局: AbsoluteLayout(絕對佈局): xmlns:android="http://scmemas.android.com/apk/res/android" style="@..." android:clipChildren=

原创 做android應用、遊戲時全屏界面

  super.onCreate(savedInstanceState); //寫在這個位置↓   // 隱去電池等圖標和一切修飾部分(狀態欄部分)

原创 變量設置intent跳轉後的類名變量問題哦

例如: Intent intent = new Intent(SinglePlayer.this,jump01.class); startActivity(intent); Intent intent = new Intent(Singl

原创 [Android UI界面] 你導入工程的時候遇沒遇到過,工程裏面的xml文件就有代碼,沒有可見視圖界面,並且寫代碼的時候還聯想不出來

 對着xml右鍵-》open with-》android layout editor 點贊 收藏 分享 文章舉報 呼風即是雨 發佈了23 篇原創文章 · 獲贊 4 · 訪問量

原创 獲取手機屏幕大小代碼

         public static String getDisplayMetrics(Context cx) {                 String str = "";                 DisplayM

原创 開機動畫

java中的代碼: OnClickListener {  private ImageButton imagebtn;  private AnimationDrawable animationDrawable;  @Override  pr

原创 Button或者ImageButton的背景設爲透明或者半透明

 半透明<Button android:background="#e0000000"  /> 透明<Button android:backgrou

原创 android-drawable大小

 240×320 320×480 480×800 點贊 收藏 分享 文章舉報 呼風即是雨 發佈了23 篇原創文章 · 獲贊 4 · 訪問量 2萬+ 私信

原创 如何讓10個button 依次換圖片,形成連續效果

  傳一個開始位置的座標,傳一個結束位置的座標,然後依次循環遍歷,利用線程休眠達到效果    for (j = frommo; j < tomo; j++) {         runOnUiThread(new Runnable() {

原创 ~~~應用推廣必備發佈渠道~~~

~~應用推廣必備發佈渠道~~~   安智市場    http://www.goapk.com/ 小祕笈:註冊後臺發佈應用,比較簡單快捷。 安卓市場    http://sc.hiapk.com/ 小祕笈:註冊後臺發佈應用,比較簡單快捷。

原创 android tween、frame動畫

  動畫效果 編程基礎--Animation Android 動畫類型 Android的 animation 由四種類型組成 XML 中 a

原创 android json解析及簡單例子

JSON的定義:        一種輕量級的數據交換格式,具有良好的可讀和便於快速編寫的特性。業內主流技術爲其提供了完整的解決方案(有點類似於正則表達式 ,獲得了當今大部分語言的支持),從而可以在不同平臺間進行數據交換。JSON採用兼容

原创 一個簡單的隨機數字

 int rnd = 1 + (int) (Math.random() * 5);

原创 反射跳轉活動

 Intent intent = new Intent(); intent.setClass(firstActivity.this,Class.forName("你的包名.Activity"+你的隨機數)); startActivity(