小编ilw*_*ilw的帖子

CLion和CMake:只构建没有可执行文件的库?

如何只用clion构建一个没有可执行文件的静态库?CMakeLists.txt如何?(没有add_executable)

更新:如果我不向Clion添加可执行文件,我有一个 错误,需要一个可执行文件.

这是我的CMakeLists.txt.

cmake static-libraries clion

13
推荐指数
1
解决办法
9123
查看次数

如何确定是否显示任何系统对话框?

如何检查dialogAndroid中是否显示任何系统(如下面的系统或USSD)?

飞机模式切换对话框

编程方式还是cmd root方式?任何变种.

android dialog root

12
推荐指数
2
解决办法
1483
查看次数

什么是弃用的"managedQuery"的适当替换者?

Android文档说:此方法在API级别11中已弃用.

这是代码:

class GridViewActivity_ extends     Activity
  {
    @Override
    protected void onCreate(Bundle  savedInstanceState)
    {
        super.onCreate(savedInstanceState);
    setContentView(R.layout.gridview);

    GridView gv = (GridView)findViewById(R.id.gridview);

    Cursor c = managedQuery(Contacts.CONTENT_URI, 
            null, null, null, Contacts.DISPLAY_NAME);

    String[] cols = new String[]{Contacts.DISPLAY_NAME};
    int[]   views = new int[]   {android.R.id.text1};

    SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
            android.R.layout.simple_list_item_1,
            c, cols, views);
    gv.setAdapter(adapter);
}
 }
Run Code Online (Sandbox Code Playgroud)

如何替换此代码,而不是弃用代码?

对于活动,不是片段......

android android-contentprovider

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

如何使用CMake在项目中添加预构建的静态库?

Clion:如何在我的项目中添加或(使用)预构建的静态库?

cmake static-libraries clion

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

ConstraintLayout - 避免重叠

有一个ConstraintLayout布局:

<android.support.constraint.ConstraintLayout
    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">

    <Button
        android:id="@+id/button10"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ellipsize="end"
        android:singleLine="true"
        android:text="small text"
        app:layout_constraintLeft_toLeftOf="parent"/>

    <Button
        android:ellipsize="end"
        android:singleLine="true"
        android:id="@+id/button11"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="small text"
        app:layout_constraintRight_toRightOf="parent"/>

</android.support.constraint.ConstraintLayout>
Run Code Online (Sandbox Code Playgroud)

它显示如下: введитесюдаописаниеизображения 现在没关系,但是如果我改为 android:text="small text",android:text="big teeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeext"那么视图会相互重叠..

我需要确保使用小文本有一个"换行内容",正如我在上面的屏幕截图中所做的那样,但是如果文本较大,则文本视图必须占据父级的大约40%的水平.那么文本也没有转移 - 我愿意android: ellipsize =" end "android: singleLine =" true.

这应该是这样的(在Photoshop中进行编辑以进行演示): введитесюдаописаниеизображения 如何使用ConstraintLayout或者如果不能 - 使用其他布局?

android text textview android-constraintlayout

10
推荐指数
2
解决办法
7685
查看次数

如何更改Gradle安装任务

我想编辑名为installDebug的 gradle任务.任务(或脚本)位于何处?也许这个脚本位于二进制代码中,我不会改变它?

真的,我想运行编辑某些选项adb.示例:我的任务必须包含:

  1. 运行adb,例如"adb connect 192.168.1.2:5555"
  2. 直接运行"debugInstall"gradles任务.
  3. 做一些事情,比如 - adb然后在我的adb服务器上打开apk.

我该怎么做:如果可能的话编辑debugTask?或者编辑build.grade并创建自己的任务脚本?

android gradle

6
推荐指数
1
解决办法
2487
查看次数

如何在JetBrains Clion中更改项目字符集

我可以在Microsoft visual studio中将Project Character Set更改为Unicode或Multi-Byte,如图所示.

在此输入图像描述

但是,在clion中可能是同样的事情吗?

c c++ character-encoding visual-studio clion

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

如何将新的 conscrypt 库集成到 Android 中并默认使用它

在android中,如果我得到(SSLSocketFactory) SSLSocketFactory.getDefault()我得到这个类的内部套接字工厂com.android.org.conscrypt.OpenSSLSocketFactoryImpl

添加此依赖后

dependencies {
  implementation 'org.conscrypt:conscrypt-android:2.2.1'
}
Run Code Online (Sandbox Code Playgroud)

我想(SSLSocketFactory) SSLSocketFactory.getDefault()从 new lib() 获取工厂org.conscrypt.OpenSSLSocketFactoryImpl,但仍然获取内部com.android.org.conscrypt.OpenSSLSocketFactoryImpl. 新的 SocketFactory 的集成算法是什么?

android google-conscrypt

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

从xml充气android.support.v4.app.fragment的正确方法

请帮忙.

哪个是对的?

像这样:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal" >

    <android.support.v4.app.fragment
        android:id="@+id/advertListFragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:name="com.myapp.fragment.AdvertListFragment"/>
Run Code Online (Sandbox Code Playgroud)

或者像这样:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal" >

    <fragment
        android:id="@+id/advertListFragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:name="com.myapp.fragment.AdvertListFragment"/>
Run Code Online (Sandbox Code Playgroud)

没有前缀"android.support.v4".

我没有更多细节

android android-fragments android-support-library

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

如何以编程方式制作动画

例如,xml动画:

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true">

<!-- Rotate -->
<rotate
    android:duration="500"
    android:fromDegrees="30"
    android:interpolator="@android:anim/linear_interpolator"
    android:pivotX="50%"
    android:pivotY="50%"
    android:repeatCount="4"
    android:repeatMode="reverse"
    android:toDegrees="0"/>

<!--Move-->
<translate
    android:duration="1000"
    android:fromXDelta="0%"
    android:fromYDelta="150%"
    android:interpolator="@android:anim/linear_interpolator"
    android:toXDelta="0%"
    android:toYDelta="0%"/>

<!--Fade In-->
<alpha
    android:duration="2000"
    android:fromAlpha="0.0"
    android:interpolator="@android:anim/decelerate_interpolator"
    android:toAlpha="1.0"/>

</set>
Run Code Online (Sandbox Code Playgroud)

是否可以通过Java代码创建此代码?

animation android

3
推荐指数
1
解决办法
2213
查看次数

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