2013-07-26 4 views
0

편집 텍스트에서 데이터를 가져 와서 Gmail ID를 통해 보내려고하지만 '이 앱을 수행하는 앱이 없습니다'라는 메시지가 나타납니다. 당신이 SDK 시뮬레이터를 사용하는 경우 안드로이드 감사Gmail을 통해 메일을 보내려면 어떻게해야합니까?

public void onClick(View v) { 
     // TODO Auto-generated method stub 
     if(v.getId() == R.id.send) 
     { 
      String name = objName.getText().toString(); 
      Intent email = new Intent(Intent.ACTION_SEND); 
      email.putExtra(Intent.EXTRA_EMAIL, new String[]{ "[email protected]"}); 
      email.putExtra(Intent.EXTRA_SUBJECT, name); 
      email.setType("message/rfc822"); 
      startActivity(Intent.createChooser(email, "Send Mail :")); 

     } 
    } 

답변

1

는 다음의 Gmail 응용 프로그램이 설치 필요하지 않을 수,

public void onClick(View v) { 
     // TODO Auto-generated method stub 
     if(v.getId() == R.id.send) 
     { 
      String name = objName.getText().toString(); 
      Intent email= new Intent(android.content.Intent.ACTION_SEND); 
      email.setType("text/plain"); 
      email.putExtra(Intent.EXTRA_EMAIL, new String[]{ "[email protected]"}); 
      email.putExtra(Intent.EXTRA_SUBJECT, name); 
      startActivity(email); 

     } 
    } 
+0

이제이 코드는 나에게 이메일 ID와 메시지를 작성해야하는 다른 화면을 보내고 있습니다. – Deepak

+0

그게 맞고, putextra 기능이 미리 채워져 있어야합니다. – Oli

+0

이 미리 채워지지 않은 상태에서 보내기 버튼을 클릭해야 이메일 ID와 메시지를 다시 작성해야합니다. – Deepak

0

을보십시오.

+0

그러면 문제를 해결하기 위해이 작업을 수행 할 수 있습니다. – Deepak

관련 문제