2011-10-26 3 views
0

android를 사용하여 광고 확장을 만들고 있습니다. 안드로이드 부분에 문제가 있습니다.Android, Resource를 받으시겠습니까?

나는 context.getResourceId를 사용하여 mySound를 얻습니다. mySound는 어떤 var 유형이어야합니까?

public FREObject call(FREContext context, FREObject[] args) { 
    mySound = (context.getResourceId("my_sound")); 
} 
+0

이 사운드 파일은 무엇입니까? –

+0

예 mp3. – panthro

+0

http://developer.android.com/guide/topics/media/mediaplayer.html "MediaPlayer 사용" –

답변

0
나는 당신이 당신의 질문을하지만, 단지의 경우 여기에 내 대답 한 이후 잠시왔다 알고

: FREContext 클래스의 방법 context.getResourceId은 안드로이드 보통 R.xxx.my_resource_name에 대신 할 . 따라서 과 같은 일반적인 안드로이드 메소드에서 사용할 수있는 int을 반환합니다 (예 : View). 기본적으로 Air Native Extension을 사용할 때 어디에서나 자원 식별자를 사용해야합니다. 전체 예제는 다음과 같습니다.

// When using ANE with the FREContext class 
Button btn = (Button) view.findViewById(asContext.getResourceId("id.authButton")); 

// Regular Android way where R is your resource file containing all the resource identifier 
Button btn = (Button) view.findViewById(R.id.authButton)); 
관련 문제