在Android 5.x设备上进行最新的Android System WebView更新(44.0.2403.39)后,我的cordova应用程序出现问题.
我想更新复制SDK模拟器上的问题.但Android 5.1的标准图像附带WebView版本39.
有没有办法在模拟器上更新此组件?
我发现的APK更新这里,但在安装后显示在系统设置中的应用程序名单上的两个条目,它不是更新.所以我不能复制这个问题.
第一个是模拟器v39附带的视图,第二个是v44
我有一个蓝色背景的按钮样式,在API 22中工作正常,但相同的按钮显示为深灰色而没有在Android 4中应用的样式.这是我的风格:
<style name="MyApp.Plain" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">@drawable/background</item>
<item name="android:buttonStyle">@style/MyApp.Widget.Button</item>
</style>
<style name="MyApp.Widget.Button" parent="@android:style/Widget.Button">
<item name="android:background">@drawable/btn_blue</item>
<item name="android:focusable">true</item>
<item name="android:clickable">true</item>
<item name="android:textStyle">bold</item>
<item name="android:textSize">14sp</item>
<item name="android:textColor">#fff</item>
<item name="android:gravity">center_vertical|center_horizontal</item>
</style>
Run Code Online (Sandbox Code Playgroud)
我的btn_blue.xml
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/btn_disabled" android:state_enabled="false"/>
<item android:drawable="@drawable/btn_pressed" android:state_enabled="true" android:state_pressed="true"/>
<item android:drawable="@drawable/btn_normal_blue" android:state_enabled="true"/>
</selector>
Run Code Online (Sandbox Code Playgroud)
和btn_normal_blue.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<gradient
android:angle="90"
android:endColor="#368ac6"
android:startColor="#0e58a4" />
<corners android:radius="20dp" />
</shape>
Run Code Online (Sandbox Code Playgroud)
可能是这种行为的原因,我该如何解决这个问题?
编辑:这不支持v7:22.2.0,但适用于v7:21.0.3.除了依赖项之外,我没有更改任何内容,并将AppCompatActivity更改为ActionBarActivity.
可能这是一个Android错误.
android styles android-4.1-jelly-bean android-5.1.1-lollipop
鉴于具有共享元素的Activity的正常Lollipop转换,例如https://github.com/codepath/android_guides/wiki/Shared-Element-Activity-Transition,很常见的是从View of Recycler View转换为正常的目标活动视图.
但是,如果是目标视图,也是在recyclerView的视图中,是否有可能实现这一点(即向ActivityOptionsCompat提供目标视图)?
谢谢!
android android-transitions shared-element-transition android-5.1.1-lollipop
我的设备运行Android 5.1.1,我发现如果我使用
Toast.makeText(this, "This is a toast", Toast.LENGTH_SHORT).show();
Run Code Online (Sandbox Code Playgroud)
我懂了:
但如果我用getApplicationContext()
而不是this
,
Toast.makeText(getApplicationContext(), "This is a toast", Toast.LENGTH_SHORT).show();
Run Code Online (Sandbox Code Playgroud)
我懂了:
两者都是直接从活动中调用的.
为什么是这样?
android android-context android-toast android-5.1.1-lollipop
我搜索了所有的东西并进行了实验,但没有运气NavigationView
.
itemIconTint
,itemTextColor
并itemBackground
有效地工作ripple
.但问题state selected
不起作用selector drawable
我也创造drawable-v21
并投入ripple_navigation_selector.xml
我的目标是当再次打开抽屉时,之前选择的项目应为黄色,例如.通知项目
NavigationView
在main_layout.xml中
<android.support.design.widget.NavigationView
android:id="@+id/navigation_view"
android:layout_width="250dp"
android:layout_height="match_parent"
android:layout_gravity="end"
android:background="@color/black"
app:headerLayout="@layout/header"
app:itemIconTint="@drawable/navigation_view_icon_tint_selector"
app:itemTextColor="@drawable/navigation_view_text_selector"
app:menu="@menu/drawer"
app1:itemBackground="@drawable/ripple_navigation_selector"
/>
Run Code Online (Sandbox Code Playgroud)
ripple_navigation_selector.xml
内 drawable-v21
<item
android:id="@android:id/mask"
android:drawable="@drawable/navigation_selector"/>
<item android:drawable="@drawable/navigation_selector"/>
Run Code Online (Sandbox Code Playgroud)
navigation_selector.xml
内 drawable-v21
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@color/left_light_yellow" android:state_pressed="true"></item>
<item android:drawable="@color/left_light_yellow" android:state_activated="true"></item>
<item android:drawable="@color/left_light_yellow" android:state_checked="true"></item>
<item android:drawable="@android:color/black"></item>
Run Code Online (Sandbox Code Playgroud)
颜色字符串命名 left_light_yellow
<color name="left_light_yellow">#F6CE20</color>
Run Code Online (Sandbox Code Playgroud) android rippledrawable android-5.1.1-lollipop android-navigationview
我用Apache cordova为Android编写了一个启动器应用程序.这是一个类似于信息亭的应用程序,基本上它工作正常.
不幸的是有一个问题:在某些情况下,Android会强制查杀我的应用并立即重新启动它. - 加载大约需要3秒钟,显示白屏.它开始全新(onPause,onResume不被调用).在日志中我找到:
V/WindowManager( 657): Changing focus from Window{42544288 u0 com.android.settings/com.android.settings.SubSettings} to Window{428ad610 u0 com.android.settings/com.android.settings.SubSettings} Callers=com.android.server.wm.WindowManagerService.addWindow:2665 com.android.server.wm.Session.addToDisplay:163 android.view.IWindowSession$Stub.onTransact:111 com.android.server.wm.Session.onTransact:126
I/WindowManager( 657): Gaining focus: Window{428ad610 u0 com.android.settings/com.android.settings.SubSettings}
...
I/ActivityManager( 657): Force stopping com.myapp.name appid=10119 user=0: clear data
I/ActivityManager( 657): Killing 2639:com.myapp.name/u0a119 (adj 7): stop com.myapp.name
I/ActivityManager( 657): Force finishing activity ActivityRecord{42542218 u0 com.myapp.name/.MainActivity t2}
V/ActivityManager( 657): Broadcast: Intent { act=android.intent.action.PACKAGE_RESTARTED dat=package:com.myapp.name flg=0x10 (has extras) } ordered=false userid=0 callerApp=null
V/ActivityManager( 657): Broadcast: Intent { act=android.intent.action.PACKAGE_DATA_CLEARED dat=package:com.myapp.name flg=0x10 (has extras) } …
Run Code Online (Sandbox Code Playgroud) android bluetooth cordova android-4.4-kitkat android-5.1.1-lollipop
需要一些建议或想法.
我正在尝试用Jenkins构建Android 5.1.1 Lollipop.但它无法构建libwebviewchromium.so:
...
out/target/product/generic/obj/GYP/shared_intermediates/blink/bindings/core/v8/V8SVGNumber.cpp:55: error: undefined reference to 'blink::SVGNumberTearOff::setValue(float, blink::ExceptionState&)'
out/target/product/generic/obj/STATIC_LIBRARIES/third_party_WebKit_Source_core_webcore_generated_gyp_intermediates/SVGElementFactory.cpp:383: error: undefined reference to 'blink::SVGMetadataElement::create(blink::Document&)'
external/chromium_org/third_party/WebKit/Source/core/svg/SVGNumberTearOff.h:45: error: undefined reference to 'blink::SVGNumberTearOff::SVGNumberTearOff(WTF::PassRefPtr<blink::SVGNumber>, blink::SVGElement*, blink::PropertyIsAnimValType, blink::QualifiedName const&)'
collect2: error: ld returned 1 exit status
make: *** [out/target/product/generic/obj/SHARED_LIBRARIES/libwebviewchromium_intermediates/LINKED/libwebviewchromium.so] Error 1
Run Code Online (Sandbox Code Playgroud)
同时,当我尝试手动构建它时,它成功:
. build/envsetup.sh
set_stuff_for_environment
lunch zh2_qemu_eng
make clean
make -j24
Run Code Online (Sandbox Code Playgroud)
我想知道当使用控制台时相同的操作可以成功,并且在使用Jenkins时失败.你能和我分享你的想法吗?
PS构建机器有24GB RAM和15GB交换文件,以及512 GB SSD闪存盘(62%可用).操作系统是Ubuntu 14.04LTS,64位.
$ free -m
total used free shared buffers cached
Mem: 24021 22079 1942 75 4778 8768
-/+ buffers/cache: 8532 15488
Swap: 16036 345 15691
Run Code Online (Sandbox Code Playgroud) android android-source jenkins webviewchromium android-5.1.1-lollipop
我正在使用AutoCompleteTextView
我的布局.但它colorControlNormal
并Activate
没有像我预期的那样工作.
我的颜色值是#0072BA
.
下面是不同设备的图.
1.)Android Kitkat
2.)Android LolliPop
3.)Android Marshmallow
我使用的Xml代码如下
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/md_black_1000"
android:layout_marginTop="5dp"
android:textSize="15sp"
android:text="Medical Store Name"
android:textColorHint="#999999"
android:layout_below="@+id/search_drug_store"
android:id="@+id/autoCompleteTextView_storename"
android:layout_marginLeft="15dp"
android:layout_marginRight="10dp"/>
<AutoCompleteTextView
android:id="@+id/autoCompleteTextView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:textSize="12sp"
android:textColor="#999999"
android:layout_below="@+id/autoCompleteTextView_storename"
android:layout_marginLeft="25dp"
android:inputType="textNoSuggestions"
android:layout_marginRight="10dp"/>
Run Code Online (Sandbox Code Playgroud)
我没有给AutoCompleteTextView任何样式然后它为什么会发生?
如果我给这个风格
参考材料设计链接:
http://www.materialdoc.com/autocomplete-view/
并给这种风格
<style name="Autocomplete" parent="Widget.AppCompat.Light.AutoCompleteTextView">
<item name="android:background">@color/green500</item>
<item name="colorControlNormal">@color/amber500</item>
<item name="colorControlActivated">@color/cyan500</item>
</style>
Run Code Online (Sandbox Code Playgroud)
但在棒棒糖中没有任何变化.
这是棒棒糖版本中的错误还是我做错了什么?
android autocompletetextview android-layout android-design-library android-5.1.1-lollipop
我们之前开发了一个应用程序,用于软糖到牛轧糖,但现在我们在视觉工作室更新我们的xamarin后出现了问题.
以前,我们的apk完全在所有Android版本中运行,但现在更新后,它现在崩溃...但仅在5.1.1.我们已经用kitkat,棒棒糖5.1,棉花糖和牛轧糖进行了测试,它确实在运行.
我们注意到我们的应用程序在OnCreate方法中的最后一个大括号"}"之后崩溃了.它在没有事先细节的情况下发布了一个例外.
这个例外的原因是什么?或任何解决方案,如果有人已经解决它.
我不知道它是否只是由于xamarin更新而改变的设置.
例外情况仅发生在OPPO手机上,在其他5.1和5.1.1版本上进行了测试
Exception image is here and as I said, there is no single detail
Here is the debugger output
Android application is debugging.
Mono Warning: option gen-compact-seq-points is deprecated.
07-14 10:37:16.613 W/monodroid(18119): Trying to load sgen from: /data/app/RBOS_2.x_0.x_1.RBOS_2.x_0.x_1-1/lib/arm/libmonosgen-2.0.so
07-14 10:37:16.613 W/monodroid-debug(18119): Trying to initialize the debugger with options: --debugger-agent=transport=dt_socket,loglevel=0,address=127.0.0.1:29342,server=y,embedding=1
07-14 10:37:16.953 W/monodroid-debug(18119): Accepted stdout connection: 29
07-14 10:37:18.793 W/monodroid-gc(18119): GREF GC Threshold: 46080
07-14 10:37:18.793 W/monodroid(18119): Calling into managed runtime init
Loaded assembly: RBOS 2.0.1.dll …
Run Code Online (Sandbox Code Playgroud) 我正在开发一个需要此权限的应用程序:android.permission.MANAGE_USB
。
我知道此权限仅在系统应用程序中授予。
如果我在 android 4.1.2 中将该应用程序安装为系统应用程序,则该应用程序可以正常工作。
但是如果我尝试将它作为系统应用程序安装在 android 5.1 中,那么调试日志会打印出我没有权限:
错误:
W/System.err: java.lang.SecurityException:
Neither user 10074 nor current process has android.permission.MANAGE_USB.
Run Code Online (Sandbox Code Playgroud)
有人知道为什么它在 android 5.1 中一直给我这个错误吗?
显现:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.app">
<uses-permission android:name="android.permission.MANAGE_USB"
android:protectionLevel="signature" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.GET_TASKS"/>
<permission android:name="android.permission.SET_TIME"
android:protectionLevel="signatureOrSystem"
/>
<uses-feature android:name="android.hardware.usb.host"
android:required="true"/>
<application
android:name=".services.AppContext"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:largeHeap="true"
android:supportsRtl="true"
android:hardwareAccelerated="false"
android:theme="@style/AppTheme">
<service android:name=".services.KioskService" android:exported="false"/>
<activity …
Run Code Online (Sandbox Code Playgroud) java permissions android android-4.1-jelly-bean android-5.1.1-lollipop