我正在使用Android Studio 0.2.3,当正常打开活动布局时,预览应该出现在右侧,这样我就可以在文本和设计模式之间切换,这将再次显示布局的预览.
但是当我处于文本模式或设计模式时,右侧都没有显示预览.我刚收到错误rendering problems...
当我编译所有内容并在我的设备上安装应用程序时,它可以正常运行.对于开发和试验布局,如果我可以使预览工作仍然会很好.
我也尝试在工作室中的不同设备之间切换,但没有成功.
有谁知道如何解决这个问题?
我不是新的Android和我很好用的版本处理,以及如何调节它,但是当我看到这是困扰我...
// Check if we're running on Android 5.0 or higher
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
// Call some material design APIs here
} else {
// Implement this feature without material design
}
Run Code Online (Sandbox Code Playgroud)
在任何设备前棒棒糖此行将崩溃的应用程序,因为Build.VERSION_CODES.LOLLIPOP字段不存在......所以这是为什么在文档中推荐的解决方案?
我真的很想知道我错过了什么?
是否可以在"添加到主屏幕>小部件"对话框中显示小部件仅适用于某个Android版本而无需上传两个APK并分配到正确的SDK版本号?
a)Android软件包版本和版本代码表示什么?
b)捆绑版本和版本代码之间有什么区别?
i)假设我有一个捆绑版本0.137,版本代码与此有何关系?版本代码可以是137吗?
ii)当我1.0下次发布捆绑版本时会发生什么?我可以调用版本代码10吗?
c)它们如何相关?对捆绑版本进行编号的正确方法是什么?
NB在搜索中似乎没有一个解释差异的来源.到目前为止,我一直非常偶然地编写我的捆绑包,但我想知道如何做到这一点.
这些名称似乎特定于Unity,但我不确定我是否理解参数甚至是从该页面的内容...
android version unity-game-engine android-version google-play
我正在开发一个简单的演示.在这个演示中,我只是创建一个简单的自定义警报对话框.它工作正常.
当我在1.6中构建应用程序时,它向我展示了完美的结果,但是当我将Android版本从1.6更改为2.2时,它显示了意外的结果.它不显示我显示自定义警报对话框的背景屏幕.
这是我的xml文件. 自定义对话框主题文件
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="CustomDialogTheme" parent="@android:style/AlertDialog">
<item name="android:windowFrame">@null</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:backgroundDimEnabled">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowAnimationStyle">@android:style/Theme.Dialog</item>
</style>
</resources>
Run Code Online (Sandbox Code Playgroud)
这是我的CustomConfirmOkDialog类
package com.utility.org;
import android.app.Activity;
import android.app.Dialog;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
public class CustomConfirmOkDialog extends Dialog implements OnClickListener
{
private Button okButton = null;
private TextView infoText=null,confirmBody=null;
private int errorMessage=0;
@SuppressWarnings("unused")
private Activity activity;
public CustomConfirmOkDialog(Activity context,int customdialogtheme,int errorMessage)
{
super(context,customdialogtheme);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.confirm_ok);
this.errorMessage = errorMessage;
this.activity = context; …Run Code Online (Sandbox Code Playgroud) 我正在为android(2.1> 3.1)编写一个应用程序,我想使用熟悉的做法,在Honeycomb应用程序中使用应用程序图标进行家庭活动,但是,当我在早期的非Honeycomb设备上运行活动时Activity.getActionBar(); 方法尚不存在,app force关闭,如果设备运行蜂窝,我怎么才能运行这个指定的代码?
@Override
protected void onStart() {
super.onStart();
ActionBar actionBar = this.getActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
}
Run Code Online (Sandbox Code Playgroud)
感谢您的帮助,祝您度过愉快的一天.
I have a DialogFragment that handles login and fingerprint authentication for my application. This fragment uses two classes that are exclusive to API 23, KeyGenParameterSpec and KeyPermanentlyInvalidatedException. I had been under the impression that I could use these classes, as long as I check the build version before I try to initialize the classes (outlined here):
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
...
} else {
...
}
Run Code Online (Sandbox Code Playgroud)
But it appears that this is not the case. If I try …
android dalvik android-version android-api-levels android-fingerprint-api
我在我的android版本中收到这些警告.
Warning:(19, 9) Attribute `layout_marginVertical` is only used in API level 26 and higher (current min is 24)
Warning:(20, 9) Attribute `layout_marginHorizontal` is only used in API level 26 and higher (current min is 24)
Run Code Online (Sandbox Code Playgroud)
显然,我们的应用程序的布局使用了API级别26中引入的属性layout_marginVertical和layout_marginHorizontal属性.警告使得听起来好像这些属性在24级设备上不起作用,但实际上它们完美地工作.我想明白为什么我会收到这些警告,尽管看似没有错.
一个明显的解决方案是使用"longhand":marginTop而marginBottom不是marginVertical,但我希望尽可能继续使用这些"短"参数,以提高可读性并减少重复.
这些属性是否未记入第24级?或者在游戏中是否存在某种向后兼容性?如果是这样,为什么要警告?
我们正在使用:
<uses-sdk
android:minSdkVersion="24"
android:targetSdkVersion="26" />
Run Code Online (Sandbox Code Playgroud)
更新:设置targetSdkVersion="24"似乎可以修复警告,并且所需的边距继续有效.这解决了我的眼前问题,但我感到困惑,为什么一个26级功能适用于24级了,为什么目标水平26引起的警告.如果我想要达到26级,我该怎么办?
android android-version android-layout android-support-library
我可以在Android SDK管理器中看到我的计算机上安装的版本(在Android SDK管理器中),但通常一个项目使用libs文件夹中自己的副本.
有没有办法告诉除了文件日期之外在特定项目中使用的android-support-v4.jar版本是什么?
任何方法都很可观 - 通过code/eclipse /文件管理器
可能重复:
android获取系统版本
如何从代码中识别当前的Android设备操作系统?所以从我的应用程序我需要知道当前的设备版本(2是5或2.01 6甜甜圈 - 2.01或2.2 7 Eclair)?
因为如果它是2.2我想使用c2dm,但如果它低于2.2我将不会执行此操作.但我希望我的应用程序可以从Android 1.6使用.
谢谢