小编use*_*996的帖子

android中的int颜色代码如何工作?

我有以下问题:

我有一个列表视图,我想为此列表视图的项目分隔符(分隔符)指定渐变颜色.我使用以下代码:

    list = (ListView) findViewById(R.id.list);
    int[] colors = { 0, 0xffffff00, 0 }; 
    list.setDivider(new GradientDrawable(Orientation.RIGHT_LEFT, colors));
    list.setDividerHeight(4);
Run Code Online (Sandbox Code Playgroud)

我从以下网站查找颜色代码(0xffffff00):http://developer.android.com/reference/android/graphics/Color.html

问题:

然而这种颜色是黄色,我想要的是金色.我也有兴趣知道它是如何工作的,我的意思是我如何定义我选择的颜色,到目前为止我试图从开发者网站了解但是它不太清楚.

android android-listview

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

学习Java中的线程,在理解某些方面时遇到困难

我正在网上学习Java的线程,我是初学者,我在理解一些概念方面遇到了困难.谁能帮我?

链接我正在学习:http://www.codeproject.com/Articles/616109/Java-Thread-Tutorial

问题:

public class Core {
    public static void main(String[] args) {
        Runnable r0,r1;//pointers to a thread method
        r0=new FirstIteration("Danial"); //init Runnable, and pass arg to thread 1
        SecondIteration si=new SecondIteration();
        si.setArg("Pedram");// pass arg to thread 2

        r1=si; //<~~~ What is Happening here??

        Thread t0,t1;
        t0=new Thread(r0);
        t1=new Thread(r1);
        t0.start();
        t1.start();
        System.out.print("Threads started with args, nothing more!\n");
    }
}
Run Code Online (Sandbox Code Playgroud)

编辑:FirstIteration和SceondIteration的代码

class FirstIteration implements Runnable{
    public FirstIteration(String arg){
        //input arg for this class, but in fact input …
Run Code Online (Sandbox Code Playgroud)

java multithreading

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

标签 统计

android ×1

android-listview ×1

java ×1

multithreading ×1