0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

CastContext.getSharedInstance()についてのメモ

Posted at

はじめに

CastContext.getSharedInstance()について自分なりの解釈をメモとして残しておきます。

CastContext.getSharedInstance(context)

CastContext.getSharedInstance()

の違いはなんなのかと言う話です。

引数あり

CastContext.getSharedInstance(context)

CastContext には、非同期初期化のために Context または Context と Executor のいずれかを使用して getSharedInstance() を使用して共有インスタンスとしてアクセスできます。

引数ありのものはCastを使用する前に呼び出す必要があり、呼び出すことで初期化されるといった感じです。

引数なし

CastContext.getSharedInstance()

は 引数ありのものを一度呼び出して初期化した後に使用でき、返却物としては引数ありと同じなので引数にしようするContextが取得できない時などにCastContextを定義したい時などに使用します。

参考

0
0
0

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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?