안드로이드에서 다음 코드간에 차이가 있습니까?Intent 생성자를 사용하는 방법?
- 새로운 인 텐트 (this, MyOtherActivity.class);
- 새로운 인 텐트 (Context.this, MyOtherActivity.class);
- 새로운 인 텐트 (getApplicationContext(), MyOtherActivity.class);
자세한 내용을 설명해주십시오. 예제 코드도 환영합니다.
미리 감사드립니다.
안드로이드에서 다음 코드간에 차이가 있습니까?Intent 생성자를 사용하는 방법?
자세한 내용을 설명해주십시오. 예제 코드도 환영합니다.
미리 감사드립니다.
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.
당신은 * * [문서 및 가이드]를 읽어야합니다 (http://developer.android.com/guide/components/intents-filters.html) – adatapost
왜 물어? –