여기 android.content.Intent.ACTION_SEND
내가 아래 코딩 작업 예제의 의도와 모든 응용 프로그램의 목록을 얻을 수 있습니다 answer이 question에
** 공정한 경고 (내 장치에서 Gmail을 따기 끝) - 어떤 이메일 계정 설정 없었다 경우 변수 pkgAppsList
에 널 체크를 추가해야 NullPointerException이 던져 사용자에게 발견에는 전자 메일 응용 프로그램을 말할 또는 설치
//set the main intent to ACTION_SEND for looking for applications that share information
Intent intent = new Intent(Intent.ACTION_SEND, null);
//intent.addCategory(Intent.CATEGORY_LAUNCHER); //if you want extra filters
//filter out apps that are able to send plain text
intent.setType("plain/text");
//get a list of apps that meet your criteria above
List<ResolveInfo> pkgAppsList = this.getPackageManager().queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY | PackageManager.GET_RESOLVED_FILTER);
//select the first one in the list
ResolveInfo info = pkgAppsList.get(0);
String packageName = info.activityInfo.packageName;
String className = info.activityInfo.name;
//set the intent to luanch that specific app
intent.setClassName(packageName, className);
//some samples on adding more then one email address
String aEmailList[] = { "[email protected]","[email protected]" };
String aEmailCCList[] = { "[email protected]","[email protected]"};
String aEmailBCCList[] = { "[email protected]" };
//all the extras that will be passed to the email app
intent.putExtra(android.content.Intent.EXTRA_EMAIL, aEmailList);
intent.putExtra(android.content.Intent.EXTRA_CC, aEmailCCList);
intent.putExtra(android.content.Intent.EXTRA_BCC, aEmailBCCList);
intent.putExtra(android.content.Intent.EXTRA_SUBJECT, "My subject");
intent.putExtra(android.content.Intent.EXTRA_TEXT, "My message body.");
//start the app
startActivity(intent);
,369에게 있었다 것
어떤 앱을 화이트리스트에 추가하려면 특정 패키지의 각 패키지 이름을 확인하는 목록을 반복 할 수 있습니다 (예 : gmail은 "com.google.android.gm"입니다).
답장을 보내 주셔서 감사합니다.하지만 자동 채집 응용 프로그램이 아직 단계별로 도움이되지 않습니다. 고맙습니다. – Japz
코드를 작성하고 테스트하려면 – StrikeForceZero
@Japz가 작업 코드 – StrikeForceZero