-2

アンドロイドでは、次のコードに違いはありますか?

  1. new Intent(this、MyOtherActivity.class);
  2. new Intent(Context.this、MyOtherActivity.class);
  3. new Intent(getApplicationContext()、MyOtherActivity.class);

詳細に説明してください。サンプルコードもありがたいです。

前もって感謝します。

4

1 に答える 1

1
  1> new Intent(this, MyOtherActivity.class); here this means the context of your current   
    activity
  3> new Intent(getApplicationContext(), MyOtherActivity.class); here getApplicationContext() means the context of your application.
于 2012-09-15T07:52:51.157 に答える