小编Dha*_*tha的帖子

带有config的资源'attr/font'的重复值"

我现在真的知道为什么我得到这个error,我该如何解决它.其实我不确定在得到这个之前我做了什么error.

错误消息:/Users/hyun/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.0.1.arr/25699caf34fef6313d6ec32013a1a117f/res/values/values.xml错误:资源'attr/font的重复值'with config'.错误:此前定义的资源

/Users/hyun/Desktop/Laftel-Android/app/build/intermediates/incremental/mergeDbugResources/merged.dir/values/values.xml资源'attr/font'的重复值,其中包含先前在此定义的配置资源.

Java.util.concurrent.ExecutionException:com.android.tools.appt2.Aapt2Exception:AAPT2错误:检查详细信息任务':app :: mergeDebugResources'的执行失败.错误:java.utilconcurrentExcutionException:com.android.tools.aapt2.Aapt2Exception:AAPT2错误:检查日志以获取详细信息

android android-resources

39
推荐指数
4
解决办法
4万
查看次数

Android密钥库密码更改

我想更改我在密钥库中使用的密码,用于谷歌播放中已有的Android应用程序,我想在做之前了解一些事情:

1)如果我更改了密钥库密码,我是否可以继续使用相同的密钥库来存储上传的应用程序(我需要这样做,这就是我要问的原因)

2)更改我的别名密码会产生同样的后果吗?

3)我应该如何使用keytool?

android keytool google-play android-keystore

22
推荐指数
4
解决办法
2万
查看次数

CollapsingToolbarLayout在API 26中显示图像下的条形图

将支持库从v25.4.0升级到v26.0.0后,CollapsingToolbarLayout它不适合内部的内容,但在下面显示一个空白区域(可能是状态栏的大小).为了显示:

使用v25.4.0:

随着v25.4.0

随着v26.0.0:

随着v26.0.0

那个XML布局Activity

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">

    <android.support.design.widget.AppBarLayout
        android:id="@+id/appBarLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:fitsSystemWindows="true">

        <android.support.design.widget.CollapsingToolbarLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:fitsSystemWindows="true"
            app:contentScrim="?attr/colorPrimary"
            app:expandedTitleMarginEnd="64dp"
            app:expandedTitleMarginStart="48dp"
            app:layout_scrollFlags="scroll|exitUntilCollapsed"
            app:titleEnabled="false">

            <ImageView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:fitsSystemWindows="true"
                android:src="@drawable/material_flat"
                android:scaleType="fitXY"
                app:layout_collapseMode="parallax" />

            <ImageView
                android:layout_width="86dp"
                android:layout_height="86dp"
                android:layout_gravity="bottom|start"
                android:paddingBottom="16dp"
                android:paddingLeft="16dp" />


            <android.support.v7.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                app:layout_collapseMode="pin" />
        </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"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

        <TextView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:text="Minions ipsum ..." />

    </android.support.v4.widget.NestedScrollView>

</android.support.design.widget.CoordinatorLayout>
Run Code Online (Sandbox Code Playgroud)

我试过玩这个android:fitsSystemWindows值,正如这里所建议的,但结果不是预期的.如果你想查看更多细节,我的实现代码就是这个Github repo …

android android-collapsingtoolbarlayout

8
推荐指数
1
解决办法
521
查看次数

如果应用已关闭,则不会收到Firebase推送通知

我正在测试Firebase推送通知,从Firebase作曲家面板发送通知,我注意到如果我从"应用信息"面板关闭应用进程,则发送的推送通知无法到达设备.即使我再次启动应用程序,通知也会丢失,并且永远不会收到.

我也试过这个:

关闭应用程序 - >关闭设备 - >打开设备电源 - >发送通知......并且没有收到通知!

似乎firebase只能在设备启动应用程序而不是100%关闭时接收通知,我的意思是,只需使用后退键关闭它,但不会终止应用程序进程.

这怎么可能?即使应用程序关闭,firebase仍应收到通知.

我正在使用Android 8.0 测试Nexus 5X,我正在使用最新版本的Firebase push Notifications.

android push-notification firebase firebase-notifications

7
推荐指数
2
解决办法
8563
查看次数

在Android中返回null的改进响应

我想显示一个JSON值的文本.我使用Retrofit,使API呼叫我不知道如果我这样做是正确的.无论如何这是我的代码.

这是网址链接:http://api.icndb.com/jokes/random.

该网站每次都会显示一个随机笑话.以下是该网站输出的示例:

{ "type": "success", "value": { "id": 175, "joke": "When Chuck Norris was a baby, he didn't suck his mother's breast. His mother served him whiskey, straight out of the bottle.", "categories": [] } } 
Run Code Online (Sandbox Code Playgroud)

fragment.java

    String url = "http://api.icndb.com/";

    Retrofit.Builder builder = new Retrofit.Builder()
            .baseUrl(url)
            .addConverterFactory(GsonConverterFactory.create());

    Retrofit retrofit = builder.build();

    RetroFitHelper client = retrofit.create(RetroFitHelper.class);
    Call<Api> call = client.findJoke("random");

    call.enqueue(new Callback<Api>() {
        @Override
        public void onResponse(Response<Api> response, Retrofit …
Run Code Online (Sandbox Code Playgroud)

android retrofit

6
推荐指数
2
解决办法
9178
查看次数

在Android中为古吉拉特语和印地语提供语言支持

大家好知道我们如何支持Android中的印地语和古吉拉特语言支持.我使用下面的代码,但不支持,我只看到框.

我把字符串文件放在res/values-hi/string.xml文件夹中.印地语有一些关键价值.它用于印地语:

Locale locale = new Locale("hi");
Locale.setDefault(locale);
Configuration config = new Configuration();
config.locale = locale;     
getBaseContext().getResources()
                .updateConfiguration(config,getBaseContext().getResources().getDisplayMetrics());
Run Code Online (Sandbox Code Playgroud)

任何人都知道,请给我解决方案.

android

5
推荐指数
1
解决办法
2万
查看次数

排序的联系人列表有重复,为什么?

我已经将我的手机联系人排序并列入了一个arraylist但是,我在列表中找到了许多相同联系人姓名的副本.这种情况怎么样?怎么避免这个?

这是我试过的,

  cursor = getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, null, null,
                "(" + ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME + ") ASC");

  while (cursor.moveToNext()) {

        try {

            name = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME));
            phonenumber = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
            contact_names_list.add(name);
            phone_num_list.add(phonenumber);


        } catch (Exception e) {
            e.printStackTrace();
        }
Run Code Online (Sandbox Code Playgroud)

谁能帮忙?

sorting android android-contacts android-cursor

5
推荐指数
1
解决办法
601
查看次数

如何使用下载管理器获取下载的文件路径

我可以使用下载管理器从服务器下载视频。但是,当我使用以下代码记录路径时。

 String path = Environment.getExternalStoragePublicDirectory(directory).getAbsolutePath() + subpath;
 Log.e("PATH", path);
Run Code Online (Sandbox Code Playgroud)

我得到

12-15 13:29:36.787 22807-22807/com.ezyagric.extension.android E/PATH:/storage/sdcard0/EZYAGRIC/Soil Testing.mp4。

现在这与手机上的路径不同

/storage/sdcard0/Android/data/com.ezyagric.extension.android/files/EZYAGRIC/Crop Insurance.mp4

是什么带来了这种差异,如何才能获得手机中的路径?

android file path

4
推荐指数
1
解决办法
2万
查看次数