每当我尝试运行我的应用程序时,我都会收到此错误:
错误:任务执行失败
:app:transformClassesWithInstantRunSlicerForDebug'.
java.io.IOException: Failed to delete
C:\Users\ashis\AndroidStudioProjects\FirstApp\app\build\intermediates\instant-run-support\debug\restart-changes.txt**
Run Code Online (Sandbox Code Playgroud)
这是输出:
信息:Gradle任务
[:app:assembleDebug]:app:preBuild UP-TO-DATE:app:preDebugBuild UP-TO-DATE:app:checkDebugManifest:app:preReleaseBuild UP-TO-DATE:app:prepareComAndroidSupportAnimatedVectorDrawable2340Library UP-TO-DATE:app:prepareComAndroidSupportAppcompatV72340Library最新消息:app:prepareComAndroidSupportSupportV42340Library UP-TO-DATE:app:prepareComAndroidSupportSupportVectorDrawable2340Library UP-TO-DATE:app:prepareDebugDependencies:app:compileDebugAidl UP-TO-DATE:app:compileDebugRenderscript UP-TO-DATE:app:generateDebugBuildConfig UP -TO-DATE:app:mergeDebugShaders UP-TO-DATE:app:compileDebugShaders UP-TO-DATE:app:generateDebugAssets UP-TO-DATE:app:mergeDebugAssets UP-TO-DATE:app:generateDebugResValues UP-TO-DATE: app:generateDebugResources UP-TO-DATE:app:mergeDebugResources UP-TO-DATE:app:processDebugManifest UP-TO-DATE:app:processDebugResources UP-TO-DATE:app:generateDebugSources UP-TO-DATE:app:incrementalDebugJavaCompilationSafeguard UP-至今:app:compileDebugJavaWithJavac 最新版本:app:compileDebugNdk UP-TO-DATE:app:compileDebugSources UP-TO-DATE:app:buildInfoDebugLoader:app:transformClassesWithExtractJarsForDebug UP-TO-DATE:app:transformClassesWithInstantRunVerifierForDebug UP-TO-DATE:app:transformClassesWithJavaResourcesVerifierForDebug UP -TO-DATE:app:mergeDebugJniLibFolders UP-TO-DATE:app:transformNative_libsWithMergeJniLibsForDebug UP-TO-DATE:app:processDebugJavaRes UP-TO-DATE:app:transformResourcesWithMergeJavaResForDebug UP-TO-DATE:app:transformResourcesAndNative_libsWithJavaResourcesVerifierForDebug UP-TO-DATE: app:transformClassesWithInstantRunForDebug UP-TO-DATE:app:transformClasses_enhancedWithInstant + reloadDexForDebug UP-TO-DATE:app:incrementalDebugTasks:app:prePackageMarkerForDebug:app:fastDeployDebugExtractor UP-TO-DATE:app:generateDebugInstantRunAppInfo UP-TO-DATE:app:coldswapKickerDebug: app:transformClassesWithInstantRunSlicerForDebug FAILED错误:任务执行失败':app:transformClassesWithInstantRunSlicerForD ebug".java.io.IOException:无法删除C:\ Users\ashis\AndroidStudioProjects\FirstApp\app\build\intermediates\instant-run-support\debug\restart-changes.txt信息:BUILD FAILED信息:总时间:1分钟6.761秒信息:1错误信息:0警告信息:在控制台中查看完整输出
我正在制作一个带有人脸检测的自定义相机,它可以成功运行.
但我想添加贴纸,如记录/预览的脸.眼睛的位置用于在预览上正确调整大小并放置帽子,眼镜和领带等.
使用FaceOverlayView进行人脸检测
public class FaceOverlayView extends View {
private Paint mPaint;
private Paint mTextPaint;
private int mDisplayOrientation;
private int mOrientation;
private Face[] mFaces;
public FaceOverlayView(Context context) {
super(context);
initialize();
}
private void initialize() {
// We want a green box around the face:
mPaint = new Paint();
mPaint.setAntiAlias(true);
mPaint.setDither(true);
mPaint.setColor(Color.GREEN);
mPaint.setAlpha(128);
mPaint.setStyle(Paint.Style.FILL_AND_STROKE);
mTextPaint = new Paint();
mTextPaint.setAntiAlias(true);
mTextPaint.setDither(true);
mTextPaint.setTextSize(20);
mTextPaint.setColor(Color.GREEN);
mTextPaint.setStyle(Paint.Style.FILL);
}
public void setFaces(Face[] faces) {
mFaces = faces;
invalidate();
}
public void setOrientation(int orientation) {
mOrientation = …Run Code Online (Sandbox Code Playgroud) 我想用Gif或图像像Vigo更改Surface预览底部叠加层
像这样
请告诉我任何sdk或我用于此过滤器的内容
我可以使用此更改顶视图上的叠加层
PictureCallback cameraPictureCallbackJpeg = new PictureCallback()
{
@Override
public void onPictureTaken(byte[] data, Camera camera)
{
// TODO Auto-generated method stub
Bitmap cameraBitmap = BitmapFactory.decodeByteArray
(data, 0, data.length);
int wid = cameraBitmap.getWidth();
int hgt = cameraBitmap.getHeight();
// Toast.makeText(getApplicationContext(), wid+""+hgt, Toast.LENGTH_SHORT).show();
Bitmap newImage = Bitmap.createBitmap
(wid, hgt, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(newImage);
canvas.drawBitmap(cameraBitmap, 0f, 0f, null);
Drawable drawable = getResources().getDrawable
(R.drawable.mark3);
drawable.setBounds(20, 30, drawable.getIntrinsicWidth()+20, drawable.getIntrinsicHeight()+30);
drawable.draw(canvas);
File storagePath = new File(Environment.
getExternalStorageDirectory() + "/PhotoAR/");
storagePath.mkdirs(); …Run Code Online (Sandbox Code Playgroud) 我webview用来加载响应式网站,但它显示移动大小以外的宽度.
我在移动Chrome浏览器中打开该链接,看起来不错......
我的意思是说宽度不适合手机的屏幕尺寸; 它显示宽度.
我也使用这些... <viewport>用于控制其演示的标签.
WebSettings settings = webview.getSettings();
settings.setJavaScriptEnabled(true);
settings.setUseWideViewPort(true);
settings.setLoadWithOverviewMode(true);
Run Code Online (Sandbox Code Playgroud)
另外我正在使用setInitialScale正确渲染webview.
webview.setInitialScale((int) 1.0);
Run Code Online (Sandbox Code Playgroud)
但我得到的网站负载没有响应,因为根据大小...它显示宽度超出屏幕尺寸...随滚动
应用程序在Lollipop,Marshmallow等中运行良好.但是在Jellybean等中不起作用.但是Link在所有设备中都能与最新的Chrome配合使用,但是无法正常工作webview.
我也设定了......
<meta name="viewport" content="width=device-width, initial-scale=1">
Run Code Online (Sandbox Code Playgroud)
截图
我有一个折叠工具栏和嵌套滚动视图的活动FrameLayout,我将片段放在其中.最初,我FragmentA用CardView放入它.
效果很好.当我单击一个按钮时,我将其替换FragmentB为另一个包含RecyclerView的按钮.
当我添加FragmentBI cant滚动到列表的底部.
此视频显示了问题:链接到视频
主机活动布局:
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="340dp"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:fitsSystemWindows="true">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_scrollFlags="scroll|exitUntilCollapsed|enterAlwaysCollapsed"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleMarginStart="48dp"
app:expandedTitleMarginEnd="64dp">
.........
......
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="fill_vertical"
android:fillViewport="true"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
>
<!-- the layout which will be the content of the activity (which will be hosted inside the drawer (NOT the list of the drawer)) -->
<FrameLayout
android:id="@+id/frame_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
>
</FrameLayout>
</android.support.v4.widget.NestedScrollView>
Run Code Online (Sandbox Code Playgroud)
FragmentB布局:
<android.support.v4.widget.SwipeRefreshLayout …Run Code Online (Sandbox Code Playgroud) 当我点击照片并设置为我的Imageview而没有用户选择是或否时,我想显示图像....
我正在研究更多,我也非常清楚相机应用程序本身使您能够查看/重新拍摄图像,一旦图像被接受,活动就会显示它.但我想要不经审查/重拍活动显示它.....
我正在尝试这段代码
用来初始化
Uri mImageCaptureUri;
Run Code Online (Sandbox Code Playgroud)
对于单击按钮
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_SCREEN_ORIENTATION, ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
File file = new File(Environment.getExternalStorageDirectory(),
"tmp_avatar_" + String.valueOf(System.currentTimeMillis()) + ".jpg");
mImageCaptureUri = Uri.fromFile(file);
try {
intent.putExtra(MediaStore.AUTHORITY, true);
intent.putExtra("return-data", true);
intent.putExtra(MediaStore.EXTRA_OUTPUT, mImageCaptureUri);
startActivityForResult(intent, PICK_FROM_CAMERA);
} catch (Exception e) {
e.printStackTrace();
}
Run Code Online (Sandbox Code Playgroud)
onActivityResult
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
Bitmap bitmap = null;
mPath = mImageCaptureUri.getPath();
System.out.println("THE PAtH:_" + mPath);
BitmapFactory.Options o2 = new BitmapFactory.Options();
bitmap = BitmapFactory.decodeFile(mPath, o2);
ivSelfie.setImageBitmap(bitmap);
}
Run Code Online (Sandbox Code Playgroud)
当我点击照片而不是我这个屏幕选择是或否......
但我的要求不是选择评论/重拍任务,只需点击并设置.....直接设置到活动显示的ImageView .....
通过在Visual Studio 2015中使用API 19(4.4.2)创建Android项目,当我想启动应用程序时向我显示这些错误.
看

错误1: "aapt.exe"退出代码 - 1073741819.APP_Activity_Sync C:\ Program Files(x86)\ MSBuild\Xamarin\Android\Xamarin.Android.Common.targets 1665
错误2:文件"obj\Debug\android\bin\packaged_resources"不存在.APP_Activity_Sync C:\ Program Files(x86)\ MSBuild\Xamarin\Android\Xamarin.Android.Common.targets 1691
我将所有文件都下载了API19和SDK Manager.
SDK详细信息API19

有人想要类似的事情发生,这个问题的解决方案是什么?
我搜索了很多,找到了一个直接而明确的解决方案,我认为这是一个受欢迎的问题,但不幸的是我找不到它.
我们希望有一个cardview列表,以便每张卡绑定到特定数据,每张卡片内部都有一个列表,显示有关其父级的元数据或详细数据.
所以我们在cardview中有一个嵌套列表.
通过简单的搜索,我们知道我们应该使用扩展列表视图,父项是cardview,我们必须为其子项设置另一个布局.
因此,当您点击卡片时,根卡上的卡片下方会显示一个项目列表.但是我们想在卡片里面显示孩子名单?
并且无法访问子列表id或任何其他内容来引用过渡动画和更改布局.
所以明确的问题是如何在cardview中添加listview?
我通过使用tablelayout和table行来关注我的工作.并且不希望使用外部库来实现稳定性和版本问题.这就是我的意思.
描述我的问题的图像

我想这样做是为了防止卡被擦除或克隆卡。我阅读了很多文件 有些告诉用户第四个块设置读写权限..
根据@迈克尔罗兰
MIFARE 卡每个扇区的认证密钥和访问条件位于该扇区的最后一个块(扇区尾)。您可以使用常规写入命令使用新的访问条件和身份验证密钥更新此块。
扇区预告片如下所示:
+-----------------------------+--------------+----+-----------------------------+
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
+-----------------------------+--------------+----+-----------------------------+
| Key A | Access Bits | GP | Key B |
| (6 bytes) | (3 bytes) | B | (6 bytes) |
+-----------------------------+--------------+----+-----------------------------+
Run Code Online (Sandbox Code Playgroud)
因此访问位位于字节 6-8 中,如下所示:
+-------+-------+-------+-------+-------+-------+-------+-------+
| Bit 0 | Bit 1 | Bit 2 | …Run Code Online (Sandbox Code Playgroud) 试试这个...
public class MainActivity extends Activity {
PendingIntent mPermissionIntent;
Button btnCheck;
TextView textInfo;
UsbDevice device;
UsbManager manager;
private static final String ACTION_USB_PERMISSION = "com.mobilemerit.usbhost.USB_PERMISSION";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btnCheck = (Button) findViewById(R.id.check);
textInfo = (TextView) findViewById(R.id.info);
btnCheck.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
textInfo.setText("");
checkInfo();
}
});
}
public void startPrinting(final UsbDevice printerDevice) {
new Handler().post(new Runnable() {
UsbDeviceConnection conn;
UsbInterface usbInterface;
@Override
public void run() {
try {
Log.e("Info", "Bulk transfer started");
usbInterface …Run Code Online (Sandbox Code Playgroud)