android-用线程实现跑马灯

package zhang.example;

import android.app.Activity;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.ViewGroup.LayoutParams;
import android.widget.AbsoluteLayout;
import android.widget.ImageView;

@SuppressWarnings("deprecation")
public class marquee extends Activity {
	private ImageView	img;
	private DisplayMetrics dm;
	int x=0,y=0;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        img=(ImageView)findViewById(R.id.img);
        dm=new DisplayMetrics();
        getWindowManager().getDefaultDisplay().getMetrics(dm);
        x=img.getWidth();
        y=img.getHeight();
        
       move();
       
    }
    public void move(){
             new Thread(new Runnable(){
                     @SuppressWarnings("deprecation")
					@Override
                     public void run() {
                             // TODO Auto-generated method stub
                             while(true)
                             {	
                            	 	int xx=0,yy=0;
                                    if(xx

你可能感兴趣的:(Android开发)