Android
トーストとは? トーストとは、Androidアプリで画 に短いメッセージを表示するための機能 String しか表示できない 一定時間が経過すると、 フェードアウトする あの、下にふわって出てくるやつ。 public static Toast makeText(Context context…
ラジオボタンで指定した文言をログに出力させる レイアウトの作成 <RadioGroup android:id="@+id/radio_group" android:layout_width="wrap_content" android:layout_height="wrap_content"> <RadioButton android:id="@+id/radio_1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="高坂穂乃果"/> </radiobutton></radiogroup>
トグルスイッチを作ってみる Androidでトグルスイッチを作成し、CompoundButton をつかってイベントを取得してみる。 レイアウト作成 <Switch android:id="@+id/toggle_switch" android:layout_width="wrap_content" android:layout_height="wrap_content" android:checked="true" android:textColor="#3e3e3e" android:text="toggle switch button"/> CompoundButton を利用してイベン…</switch>
CheckBoxを用意し、結果をログに表示させる。 Android の CheckBox を作成して、ON/OFF をログに表示させるところまで実装をしてみる。 レイアウトの作成 <CheckBox android:id="@+id/checkbox" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="メールマガジン受信" /> クリックイベントの取得 setOnClickListener でイベント取得する。CompoundButton のほうがきれい</checkbox>…
Activityを追加して画面遷移をさせる こんな感じにした。 public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.d("MainActivity", "onCreate"…
mixi AndroidTraining mixiがgithubに公開しているAndroid学習用のページ。数年前から存在走っていたけれど、全然手を付けていなかった。 Javaはわかるけど、ネイティブを触る機会は少なく、Android Java は初心者。初心者がどこまでできるようになるか、健…