团队冲刺二(4)

5.28日

朴远东:图片显示部分作出调整,具体为捕捉图片显示为缩略图,点击后查看大图。

java:
——————
private void seeBigimg(final Bitmap bm) {
        trypng = (ImageView) findViewById(R.id.trypng);
        trypng.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View paramView) {
                LayoutInflater inflater = LayoutInflater.from(NoteView.this);
                View imgEntryView = inflater.inflate(R.layout.dialog_photo,null);
                final AlertDialog dialog = new AlertDialog.Builder(NoteView.this).create();
                ImageView img1 = (ImageView)imgEntryView.findViewById(R.id.large_image);
                img1.setImageBitmap(bm);
                dialog.setView(imgEntryView);
                dialog.show();

                imgEntryView.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View paramView) {
                        dialog.cancel();
                    }
                });
            }
        });
    }
——————
XML

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <ImageView
        android:id="@+id/large_image"
        android:layout_width="match_parent"
        android:layout_height="700dp"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"></ImageView>

</LinearLayout>

张宏伟:app跳转简直不要太难,尝试从本app跳转到自己写的记账本,连包名,路径位置都没找对,一塌糊涂,尝试新的方法

public static Intent getAppOpenIntentByPackageName(Context context,String packageName){ //Activity完整名 String mainAct = null; //根据包名寻找 PackageManager pkgMag = context.getPackageManager(); Intent intent = new Intent(Intent.ACTION_MAIN); intent.addCategory(Intent.CATEGORY_LAUNCHER); intent.setFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED|Intent.FLAG_ACTIVITY_NEW_TASK); List<ResolveInfo> list = pkgMag.queryIntentActivities(intent, PackageManager.GET_ACTIVITIES); for (int i = 0; i < list.size(); i++) { ResolveInfo info = list.get(i); if (info.activityInfo.packageName.equals(packageName)) { mainAct = info.activityInfo.name; break; } } if (TextUtils.isEmpty(mainAct)) { return null; } intent.setComponent(new ComponentName(packageName, mainAct)); return intent; } public static Context getPackageContext(Context context, String packageName) { Context pkgContext = null; if (context.getPackageName().equals(packageName)) { pkgContext = context; } else { // 创建第三方应用的上下文环境 try { pkgContext = context.createPackageContext(packageName, Context.CONTEXT_IGNORE_SECURITY | Context.CONTEXT_INCLUDE_CODE); } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); } } return pkgContext; } public static boolean openPackage(Context context, String packageName) { Context pkgContext = getPackageContext(context, packageName); Intent intent = getAppOpenIntentByPackageName(context, packageName); if (pkgContext != null && intent != null) { pkgContext.startActivity(intent); return true; } return false; }

王兵兵:框架成功应用,已将第一阶段任务整合完成,可实现记录收藏等之间的跳转,功能基本完善

原文地址:https://www.cnblogs.com/pyd2020/p/13027374.html