小编Les*_*sek的帖子

使用格式化复制Notepad ++文本?

我正在使用Notepad ++编写代码.

如何在Notepad ++中复制代码及其格式以粘贴到Microsoft Word?(即语法亮点等)

syntax-highlighting notepad++

199
推荐指数
7
解决办法
15万
查看次数

使用Volley的详细调试日志

在iOS上的Restkit中有一个详细的调试选项.RKLogConfigureByName("*", RKLogLevelTrace);.有谁知道Volley是否有相同的东西.基本上我直接使用ErrorListener,但我没有在LogCat中获得其他信息.都:

VolleyLog.e("Error: ", error.toString());
Run Code Online (Sandbox Code Playgroud)

和:

VolleyLog.e("Error: ", error.getMessage());
Run Code Online (Sandbox Code Playgroud)

打印:

2.onErrorResponse: Error: 
Run Code Online (Sandbox Code Playgroud)

android adb android-logcat android-volley

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

如何在java中创建链接列表数组?

所以我需要输入二分图的边缘,如下所示:

6
1 3
1 2
1 5
2 7
2 4
2 9
Run Code Online (Sandbox Code Playgroud)

第一个数字是边数.之后列出边缘.看看例如顶点1有多个不同的边缘,我想跟踪1连接的是什么,我认为图形的每个顶点都会有一些它连接到的顶点列表,这导致我尝试创建一个链表的数组,但我不知道我会怎么做.我试过了

LinkedList<Integer>[] vertex = new LinkedList[5];
int i = 0, m = 6;
while(i!=m){
    int temp = sc.nextInt();
    int temp2 = sc.nextInt();
    vertex[temp].add(temp2);
    i++;
}
Run Code Online (Sandbox Code Playgroud)

但是我在添加行得到了nullpointerexception.

java graph linked-list

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

布局是颠倒的?

请查看以下图片:

在此输入图像描述

第一张图片是我做的布局,它在我的设备和其他测试设备上正常显示.第二张图片是我朋友设备上显示的布局,它是相反的.我不知道为什么,它只发生在少数设备上.

这是我在xml上的布局代码.

<?xml version="1.0" encoding="utf-8"?>

<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:auto="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/coordinatorLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".activities.ComposeSmsActivity">


    <LinearLayout

        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <include
            android:id="@+id/toolbar"
            layout="@layout/toolbar_action" />

        <ScrollView
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical"
                android:padding="@dimen/padding_5">

                <com.hnib.smslater.views.FlowLayout
                    android:id="@+id/layout_name_recipient"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="@dimen/margin_10"
                    android:fontFamily="sans-serif-light"
                    android:orientation="horizontal">

                </com.hnib.smslater.views.FlowLayout>


                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:padding="@dimen/padding_10">

                    <com.hnib.smslater.views.ClearableAutoContactCompleteTextView
                        android:id="@+id/et_recipient"
                        android:layout_width="@dimen/width_et_contact"
                        android:layout_height="@dimen/height_et_default"
                        android:layout_centerVertical="true"
                        android:layout_marginTop="@dimen/margin_10"
                        android:background="@drawable/drawable_radius_gray_gray"
                        android:fontFamily="sans-serif-light"
                        android:hint="@string/to_"
                        android:imeOptions="actionDone"
                        android:padding="@dimen/padding_5"
                        android:textColorHint="@color/gray"
                        android:textSize="18sp"
                        android:textStyle="bold"
                        auto:displayPhotoIfAvailable="false"
                        auto:styleOfTypedLetters="bold"
                        auto:typeOfData="phone"
                        auto:typedLettersHaveDifferentStyle="true" />


                </RelativeLayout>


                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="@dimen/margin_5"
                    android:layout_marginTop="10dp">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentLeft="true"
                        android:fontFamily="sans-serif-light"
                        android:text="@string/message"
                        android:textColor="@color/gray"
                        android:textSize="18sp"
                        android:textStyle="bold" />

                    <TextView
                        android:id="@+id/tv_message_length"
                        android:layout_width="wrap_content" …
Run Code Online (Sandbox Code Playgroud)

android android-layout

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

自定义按钮/ EditBox是不可见的?

我在查看我的应用时遇到此错误."布局编辑器中的图形预览可能不准确:
不支持Path.isConvex.(忽略此会话)"查看错误图片:

以下是activity_main.xml中的小部件

<ImageButton
    android:id="@+id/ImageButton1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignTop="@+id/RoomEditText"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="48dp"
    android:background="@drawable/button_go"
    android:minHeight="40dp"
    android:minWidth="256dp" />

<EditText
    android:id="@+id/RoomEditText"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignLeft="@+id/ImageButton1"
    android:layout_below="@+id/imageView1"
    android:layout_marginTop="80dp"
    android:background="@drawable/editbox_round"
    android:ems="10"
    android:gravity="center_vertical|center_horizontal"
    android:inputType="text"
    android:maxLength="15"
    android:minHeight="32dp"
    android:minWidth="256dp" />
Run Code Online (Sandbox Code Playgroud)

以下是drawables:

button_go.xml

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

    <gradient
        android:angle="90"
        android:endColor="#cc1a22"
        android:startColor="#550200" />

    <corners
        android:bottomLeftRadius="15dp"
        android:bottomRightRadius="15dp"
        android:topLeftRadius="15dp"
        android:topRightRadius="15dp" >
    </corners>

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

editbox_round.xml

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

    <solid android:color="#ffffff" />

    <stroke
        android:width="1dp"
        android:color="#000000"
    />
    <corners 
        android:topLeftRadius="10dp"
        android:topRightRadius="10dp"
        android:bottomLeftRadius="10dp"
        android:bottomRightRadius="10dp"
    />
</shape>
Run Code Online (Sandbox Code Playgroud)

我不确定为什么他们出现隐形.如果有人愿意告诉我这里到底发生了什么?

java android android-view android-studio

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