把
img_qp.setOnClickListener(this);
改为
img_qp.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
}
});
这样问题就解决。
2.高配置读取低配置会导致内存猛增,最后会OOM异常,低配置读取高配置无影响。
资源文件(ldpi、mdpi、xhdpi、xxhdpi),如果设备本应读取xxhdpi文件夹,里面没有放资源文件,就会读取xhdpi已放资源文件夹,这样会导致运行内存猛增,遇到这种情况只能给xxhdpi配置文件(手机设备表现最突出,平板基本上没什么影响)
3.Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
> com.android.build.api.transform.TransformException: com.ndroid.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/rxjava.properties
File1: C:\Users\Administrator\.gradle\caches\modules-2\files-2.1\io.reactivex.rxjava2\rxjava\2.0.0\5151c737c01616c372c3d00ab145868ede10e826\rxjava-2.0.0.jar
File2: C:\Users\Administrator\.gradle\caches\modules-2\files-2.1\io.reactivex\rxjava\1.1.5\ece7b5d0870e66d8226dab6dcf47a2b12afff061\rxjava-1.1.5.jar
<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit;"><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 0, 0);">android </span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 0, 0);">{</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 0, 0);"> packagingOptions </span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 0, 0);">{</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 0, 0);"> exclude </span><span class="str" style="margin: 0px; padding: 0px; border: 0px; color: rgb(128, 0, 0);">'META-INF/<span style="font-family: 宋体; font-size: 18px;">rxjava.properties</span>'</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 0, 0);"> </span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 0, 0);">}</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 0, 0);"> </span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 0, 0);">}</span></code>
<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit;"><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 0, 0);"></span></code>
3.不用接入第三方,可达到转发到微信朋友圈
Intent intent = new Intent(); ComponentName comp = new ComponentName("com.tencent.mm", "com.tencent.mm.ui.tools.ShareToTimeLineUI"); intent.setComponent(comp); intent.setAction(Intent.ACTION_SEND_MULTIPLE); intent.setType("image/*"); intent.putExtra("Kdescription", "测试表提"); ArrayList<Uri> imageUris = new ArrayList<Uri>(); File[] files=new File[2]; files[0]=new File("/sdcard/DCIM/ceshi.jpg"); files[1]=new File("/sdcard/DCIM/ceshi.jpg"); for (File f : files) { imageUris.add(Uri.fromFile(f)); } intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, imageUris); startActivity(intent);