andorid 问题集合

1.有些设备出现下面文字:Dropping event because there is no touchable window at (908, 546).

img_qp.setOnClickListener(this);
改为
img_qp.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View v) {
// TODO Auto-generated method stub

}

});

这样问题就解决。


2.高配置读取低配置会导致内存猛增,最后会OOM异常,低配置读取高配置无影响。

资源文件(ldpimdpixhdpixxhdpi),如果设备本应读取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);  

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值