Android开发笔记

1. 查询包名下的跳转activity

PackageManager packageManager = context.getPackageManager();

Intent intent = packageManager.getLaunchIntentForPackage("com.instagram.android");

if(intent ==null) {

GLog.iTag(SocialConstant.LOG_PREFIX,"No Instagram");

Toast.makeText(context,context.getString(R.string.k52_error_for_no_instagram),Toast.LENGTH_SHORT).show();

return;

}

Intent share =newIntent(Intent.ACTION_SEND);

if(type == SocialConstant.TYPE_IMAGE) {

share.setType(REPOST_TYPE_IMAGE);

}else{

share.setType(REPOST_TYPE_VIDEO);

}

File media =newFile(mediaPath);

Uri uri = Uri.fromFile(media);

share.putExtra(Intent.EXTRA_STREAM,uri);

share.setPackage("com.instagram.android");

PackageManager packManager = context.getPackageManager();

List resolvedInfoList = packManager.queryIntentActivities(share,PackageManager.MATCH_DEFAULT_ONLY);

booleanresolved =false;

for(ResolveInfo resolveInfo: resolvedInfoList){

if(resolveInfo.activityInfo.packageName.startsWith("com.instagram.android")){

share.setClassName(

resolveInfo.activityInfo.packageName,

resolveInfo.activityInfo.name);

resolved =true;

break;

}

}


2. surfaceView黑屏问题

surfaceView.setZOrderOnTop(true);// 放置在window最上方显示

holder.setFormat(PixelFormat.TRANSPARENT);// 透明,否在会盖住原本在上面的

3. Http和Https

http://www.cnblogs.com/lovesong/p/5186200.html   

浏览器如果遇到证书问题会让你授权,像客户端这样会这么做,直接返回证书验证失败还是?https的框架有做处理吗?

你可能感兴趣的:(Android开发笔记)