当试图在我的项目中使用最新的appcompat-v7支持库时,我得到以下错误:

/Users/greg/dev/mobile/android_project/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.0/res/values-v11/values.xml
Error:(36, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
Error:(36, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
Error:(36, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
Error:(36, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'.

我怎么解决这个问题?

我得到了

open failed: EACCES(权限被拒绝)

myOutput = new FileOutputStream(outFileName);

我检查了根目录,并尝试了android.permission.WRITE_EXTERNAL_STORAGE。

我该如何解决这个问题?

try {
    InputStream myInput;

    myInput = getAssets().open("XXX.db");

    // Path to the just created empty db
    String outFileName = "/data/data/XX/databases/"
            + "XXX.db";

    // Open the empty db as the output stream
    OutputStream myOutput = new FileOutputStream(outFileName);

    // Transfer bytes from the inputfile to the outputfile
    byte[] buffer = new byte[1024];
    int length;
    while ((length = myInput.read(buffer)) > 0) {
        myOutput.write(buffer, 0, length);
    }

    // Close the streams
    myOutput.flush();
    myOutput.close();
    myInput.close();
    buffer = null;
    outFileName = null;
}
catch (IOException e1) {
    // TODO Auto-generated catch block
    e1.printStackTrace();
}

在我的应用“Tide Now WA”中,我最近测试了它的兼容性 新款Nexus 9平板电脑(Lollipop - API 21)。

它写一些按钮文本。这个应用程序使用Android 2.3和Android正确地编写文本 4.0. 即混合大写字母和小写字母。

当同一个应用程序在我的Nexus 9上运行时,所有的字母 正文均大写。

FWIW我的清单包含以下语句:

users -sdk android:minSdkVersion="10" android:targetSdkVersion="14"

我可以在我的代码中修复这个问题,还是操作系统中的一个bug 谢谢

试图移动我的东西使用工具栏而不是操作栏,但我一直得到一个错误说

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.tyczj.weddingalbum/com.xxx.xxx.MainActivity}: java.lang.IllegalStateException: This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead.
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
            at android.app.ActivityThread.access$600(ActivityThread.java:141)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:5039)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.IllegalStateException: This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead.
            at android.support.v7.app.ActionBarActivityDelegateBase.setSupportActionBar(ActionBarActivityDelegateBase.java:165)
            at android.support.v7.app.ActionBarActivity.setSupportActionBar(ActionBarActivity.java:92)
            at com.xxx.xxx.MainActivity.onCreate(MainActivity.java:113)
            at android.app.Activity.performCreate(Activity.java:5104)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
            at android.app.ActivityThread.access$600(ActivityThread.java:141)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:5039)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
            at dalvik.system.NativeStart.main(Native Method)

然后我添加了我的样式,让我的活动没有动作栏

<style name="AppCompatTheme" parent="@style/Theme.AppCompat.Light">
        <item name="android:windowActionBar">false</item>
</style>

这个主题适用于我清单中的活动

<activity
        android:name=".MainActivity"
        android:windowSoftInputMode="adjustResize|stateHidden"
        android:theme="@style/AppCompatTheme" android:screenOrientation="portrait"/>

MainActivity扩展了GooglePlayServiceActivity,所以我也设置了主题

<activity
       android:name=".GooglePlayServicesActivity"
       android:label="@string/title_activity_google_play_services"
       android:theme="@style/AppCompatTheme">

但我还是得到了错误。我也不要求窗口功能的任何地方。知道为什么我还能收到这个吗?

我一直试图改变材质的浮动动作按钮的颜色,但没有成功。

<android.support.design.widget.FloatingActionButton
    android:id="@+id/profile_edit_fab"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="end|bottom"
    android:layout_margin="16dp"
    android:clickable="true"
    android:src="@drawable/ic_mode_edit_white_24dp" />

我试着补充:

android:background="@color/mycolor"

或者通过代码:

FloatingActionButton fab = (FloatingActionButton) rootView.findViewById(R.id.profile_edit_fab);
fab.setBackgroundColor(Color.parseColor("#mycolor"));

or

fab.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#mycolor")));

但上述方法都不起作用。我也尝试了提出的重复问题的解决方案,但没有一个可行;按钮仍然是绿色的,也变成了一个正方形。

附:如果知道如何增加连锁反应也很好,我也不明白。