안드로이드에서 버튼 클릭시 커스텀 카메라 실행 (custom camera launch on button click in android)


문제 설명

안드로이드에서 버튼 클릭시 커스텀 카메라 실행 (custom camera launch on button click in android)

내 앱에서 버튼을 클릭할 때 내 사용자 지정 카메라를 열고 싶습니다. 도와주세요.

미리 감사합니다:)

private static Button button;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    OnClickButtonListener();
}

public void OnClickButtonListener() {
button = (Button) findViewById(R.id.camerabutton);
button.setOnClickListener(
    new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            // TODO Auto‑generated method stub
            Intent intent =new Intent ("com.example.hrbl.camera");
                startActivity(intent);

        }
    });

참조 솔루션

방법 1:

If it's an activity inside the app then try this

 Intent intent =new Intent (MyAcitivty.this, CustomCameraActivity.class);
            startActivity(intent);

Just change the activity names so they fit yours

(by Al KenonAndy Joyce)

참조 문서

  1. custom camera launch on button click in android (CC BY‑SA 2.5/3.0/4.0)

#eclipse-luna #opencv4android #imagebutton #Android #android-camera






관련 질문

안드로이드에서 버튼 클릭시 커스텀 카메라 실행 (custom camera launch on button click in android)

Eclipse에서 'Hello world' Android 앱을 실행할 때 일부 오류 발생 (Facing some errors on running 'Hello world' android app from Eclipse)

Eclipse Luna scala IDE의 SQLContext.class에 대한 잘못된 기호 참조 (bad symbolic reference on SQLContext.class in Eclipse Luna scala IDE)

user.home 디렉토리에 쓰지 못하도록 Eclipse 위치를 어떻게 수정합니까? (How modify Eclipse locations to prevent write to user.home directory?)

Eclipse Luna에서 Mylyn 제거 (Uninstall Mylyn from Eclipse Luna)

Eclipse Luna는 탭 클릭 시 편집기를 분할합니다. 비활성화하는 방법? (Eclipse Luna splits editor on tab click. How to disable?)

Eclipse Luna에서 J2Objc 변환기가 파일을 생성하지 않음 (J2Objc Translator not generating files in Eclipse Luna)

Eclipse는 자동으로 종료 코드 127을 종료합니다. (Eclipse exits automatically exit code 127)

Eclipse Luna에서 그룹 시작 (Launch Groups in Eclipse Luna)

Java EE 개발자용 Eclipse를 시작할 때 R6034 오류가 발생함 (Getting R6034 error when starting Eclipse for Java EE Developers)

Eclipse 및 Tomcat - 클래스 로딩 (Eclipse & Tomcat - Class loading)

Eclipse에 E4 Orion CSS 환경 설정 편집기를 설치하는 방법은 무엇입니까? (How to get E4 Orion CSS Preference editor installed on Eclipse?)







코멘트