目前分類:Android (54)

瀏覽方式: 標題列表 簡短摘要

getWindow().getDecorView().setSystemUiVisibility(

View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION //隱藏狀態欄和標題欄

文章標籤

Saioyan梟夜 發表在 痞客邦 留言(3) 人氣()

setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_NOSENSOR);//設定螢幕不隨手機旋轉
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);//螢幕保持橫向

文章標籤

Saioyan梟夜 發表在 痞客邦 留言(0) 人氣()

前面需加入

implements AdapterView.OnClickListener, AdapterView.OnItemClickListener, AdapterView.OnItemLongClickListener

ListView lv1;

文章標籤

Saioyan梟夜 發表在 痞客邦 留言(0) 人氣()

只要在布局檔裡面加入即可

示範

文章標籤

Saioyan梟夜 發表在 痞客邦 留言(0) 人氣()

前面一定要先加入
implements Runnable
public class MainActivity extends AppCompatActivity  implements Runnable{

示範

XML

文章標籤

Saioyan梟夜 發表在 痞客邦 留言(0) 人氣()

String board = Build.BOARD;// 主機版名稱
String brand = Build.BRAND;// 品牌名稱

文章標籤

Saioyan梟夜 發表在 痞客邦 留言(1) 人氣()

Toast toast;

toast=Toast.makeText(this,"早安您好",Toast.LENGTH_LONG);//停留長時間

文章標籤

Saioyan梟夜 發表在 痞客邦 留言(0) 人氣()

ToggleButton toggleButton;

toggleButton=(ToggleButton)findViewById(R.id.toggleButton);

文章標籤

Saioyan梟夜 發表在 痞客邦 留言(0) 人氣()

RadioGroup rg1;

RadioButton rb1;

文章標籤

Saioyan梟夜 發表在 痞客邦 留言(0) 人氣()

CheckBox checkBox;

checkBox=(CheckBox)findViewById(R.id.checkBox);

文章標籤

Saioyan梟夜 發表在 痞客邦 留言(0) 人氣()

ImageView ig1;

ig1=(ImageView)findViewById(R.id.ig1);

文章標籤

Saioyan梟夜 發表在 痞客邦 留言(0) 人氣()

EditText ed1;

ed1=(EditText)findViewById(R.id.ed1);

文章標籤

Saioyan梟夜 發表在 痞客邦 留言(0) 人氣()

Button button;

b1=(Button)findViewById(R.id.b1);

文章標籤

Saioyan梟夜 發表在 痞客邦 留言(0) 人氣()

TextView text;//宣告

text = (TextView)findViewById(R.id.text);

文章標籤

Saioyan梟夜 發表在 痞客邦 留言(0) 人氣()

«123