0
1

More than 1 year has passed since last update.

Androidプログラミングのimport一覧

Posted at

Androidでプログラミング(Java)で書くときに、import設定が地味に面倒だったのでまとめる。

アラート用ダイアログのインポート

import android.app.AlertDialog;
        //以降サンプルコード
        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setMessage("ここにメッセージを表示します。");
        builder.show();

SDKのバージョンチェックのインポート

import android.os.Build;

        //以降サンプルコード
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
        //ここにプログラムを各
        }

通知で利用するインポート

import android.app.NotificationChannel;
import android.app.NotificationManager;
import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationManagerCompat;

intentのインポート

import android.content.Intent;
0
1
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1