Android之导jar包审查步骤和打电话拍照微信意图代码

来源:互联网 发布:用友软件erp攻略 编辑:程序博客网 时间:2024/05/16 00:59

import Module之后一般出错自我审查步骤:

1.jar包冲突

2.版本不兼容

3.gradle版本不统一


//打电话(报警):
String phoneNumber = "110";
Intent intentPhone = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + phoneNumber));

startActivity(intentPhone);


//打开微信:
Intent intent = new Intent();
ComponentName cmp = new ComponentName("com.tencent.mm", "com.tencent.mm.ui.LauncherUI");
intent.setAction(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setComponent(cmp);

startActivity(intent);

//拍照:

Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);//调用android自带的照相机
//photoUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;

startActivity(intent);


//listView滚动到会话中最后一个条目的方法

listView.setSelection(conversationList.size());