在最后一次提交之后,我在工作副本中修改了一堆文件,但我想撤消对其中一个文件的更改,就像将其重置为与最近提交的状态相同.
但是,我只想撤消单独一个文件的工作副本更改,而不是其它任何内容.
我怎么做?
我正在捕捉图像并将其设置为图像视图.
public void captureImage() {
Intent intentCamera = new Intent("android.media.action.IMAGE_CAPTURE");
File filePhoto = new File(Environment.getExternalStorageDirectory(), "Pic.jpg");
imageUri = Uri.fromFile(filePhoto);
MyApplicationGlobal.imageUri = imageUri.getPath();
intentCamera.putExtra(MediaStore.EXTRA_OUTPUT, imageUri);
startActivityForResult(intentCamera, TAKE_PICTURE);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intentFromCamera) {
super.onActivityResult(requestCode, resultCode, intentFromCamera);
if (resultCode == RESULT_OK && requestCode == TAKE_PICTURE) {
if (intentFromCamera != null) {
Bundle extras = intentFromCamera.getExtras();
if (extras.containsKey("data")) {
bitmap = (Bitmap) extras.get("data");
}
else {
bitmap = getBitmapFromUri();
}
}
else {
bitmap = getBitmapFromUri();
}
// …Run Code Online (Sandbox Code Playgroud) 如何撤消上次提交后对目录所做的每次更改,包括删除添加的文件,重置已修改的文件以及添加已删除的文件?
我正在重复使用ImageViews来显示我的显示器,但是在某些时候我没有值得把它放进去.
那么如何ImageView在Android中清除?
我试过了:
mPhotoView.invalidate();
mPhotoView.setImageBitmap(null);
Run Code Online (Sandbox Code Playgroud)
他们都没有清除视图,它仍然显示以前的图像.
请至少选择一个要在Android Studio 2.3中使用的签名版本
现在,在Android Studio中生成已签名的apk时,它会在签名的apk生成过程的最后一步中显示两个选项(CheckBox),即1. V1(Jar Signature)和2.`V2(Full APK Signature)'作为签名版本.
那么,在新的Android Studio更新中,这些V1(Jar Signature)和V2(Full APK Signature)之间有什么区别?
我应该使用哪个(或两者)来为Play商店发布的apk进行签名?
此外,当我使用第二个选项时,我在安装apk时遇到错误安装Parse Failed No Certificate.
编码时我将print语句添加到某些文件中以跟踪发生的情况.
当我完成后,是否可以恢复某些文件中的更改,但提交我实际工作的文件?
说我在文件中添加了print A,但是我修改了文件B.B是我想要提交的A,我希望回到原来的状态.
昨天我的应用程序运行完美,Android Studio但今天当我开始处理我的应用程序并运行它时,我会不断收到错误消息
安装失败,显示消息无法建立会话.
屏幕:
单击确定获取错误消息
会话'app':安装APK时出错
并且App在设备中不存在(已经卸载).请建议我该怎么办?
我有一个屏幕,其中第一个字段是EditText,它在启动时获得焦点,也弹出数字输入类型,这是非常烦人的
如何确保在活动开始时没有获得焦点,和/或输入面板没有被提升?
尝试按照说明在真实设备上安装应用程序: - http://developer.android.com/tools/device.html.最后Android Studio给出错误:
Session 'app': Error Installing APK
Run Code Online (Sandbox Code Playgroud)
我猜问题可能在我的Android设备上(它是中文Doogee X5).它在开发人员文档中没有给定的USB供应商ID,因此我决定遵循HTC随机供应商ID的说明.
我确定有一种方法可以在任何Android设备上运行应用程序,但我没有找到如何做到这一点的答案.
我正在运行Linux Ubuntu 14.04 LTS
如何使抽屉布局位于操作栏/工具栏下方?我正在使用v7:21 app compat库和新的ToolBar视图.
我看到的例子看起来像
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/my_drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- drawer view -->
<LinearLayout
android:layout_width="304dp"
android:layout_height="match_parent"
android:layout_gravity="left|start">
<!-- drawer content -->
</LinearLayout>
<!-- normal content view -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<!-- The toolbar -->
<android.support.v7.widget.Toolbar
android:id="@+id/my_awesome_toolbar"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary" />
<!-- The rest of content view -->
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
但随后工具栏将被抽屉隐藏,这使得动画汉堡图标(如v7.ActionBarDrawerToggle)无用,因为它在抽屉下方不可见,但我确实想使用新的ToolBar视图来更好地支持Material主题.
那么如何实现呢?是否可以将DrawerLayout作为非顶级视图?
android toolbar android-support-library navigation-drawer drawerlayout