Android教程網
  1. 首頁
  2. Android 技術
  3. Android 手機
  4. Android 系統教程
  5. Android 游戲
 Android教程網 >> Android技術 >> Android開發 >> 初級開發 >> android下的彩票輔助工具(二)

android下的彩票輔助工具(二)

編輯:初級開發

大樂透功能部分源代碼

////////////////////////////main.Java

package com.lotter1;

import Java.Net.MalformedURLException;
import Java.Net.URL;

import android.app.Activity;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.util.Log;
import android.view.VIEw;
import android.vIEw.Window;
import android.vIEw.WindowManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListAdapter;
import android.widget.ListVIEw;
import android.widget.SimpleCursorAdapter;
import android.widget.TextVIEw;
import android.widget.Toast;

import Java.io.BufferedReader;
import android.widget.TextVIEw;
import Java.io.IOException;
import Java.io.InputStream;
import Java.io.InputStreamReader;
import Java.Net.HttpURLConnection;
import Java.Net.MalformedURLException;
import Java.Net.URL;

import Javax.XML.parsers.DocumentBuilder;
import Javax.XML.parsers.DocumentBuilderFactory;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.VIEw;
import android.widget.Button;
import android.widget.TextVIEw;
import android.content.ContentValues;
import android.content.pm.ActivityInfo;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
public class main extends Activity {    
 private final String DEBUG_TAG = "abangsoft";
 private Button bt1,bt2,bt3,bt4,bt5,bt6;
 private EditText ed1;
 //private TextView mTextVIEw;  //進度條
 //private ProgressDialog m_dialog;  
 ListView     m_ListVIEw  = null;  
 private static int   miCount   = 0;  private String code  = "____________________________________________________________________________________";
 private String code1 = "________________________";  private SQLiteDatabase  mSQLiteDatabase = null;


 private final static String DATABASE_NAME = "ticai.db";  private final static String TABLE_NAME  = "daletou";


 private final static String TABLE_ID  = "_id";
 private final static String TABLE_NUM  = "dateNum";
 private final static String TABLE_CODE  = "code";
 private final static String TABLE_D1  = "d1";
 private final static String TABLE_D2  = "d2";
 private final static String TABLE_D3  = "d3";
 private final static String TABLE_D4  = "d4";
 private final static String TABLE_D5  = "d5";
 private final static String TABLE_D6  = "d6";
 private final static String TABLE_D7  = "d7";
 private final static String HALF_CODE       = "hcode";
 private final static String SITE            = "site";
 private final static String HSUM            = "hsum";    //private final static String CREATE_TABLE = "CREATE TABLE " + TABLE_NAME + " (" + TABLE_ID + " INTEGER PRIMARY KEY," + TABLE_NUM + " INTERGER,"+ TABLE_D1 +
 //" TEXT ,"+ TABLE_D2 + " TEXT ,"+ TABLE_D3 + " TEXT ,"+ TABLE_D4 + " TEXT ,"+ TABLE_D5 + " TEXT ,"+ TABLE_D6 + " TEXT ,"+ TABLE_D7 + " TEXT ,"+ TABLE_CODE + " TEXT ,"+HALF_CODE + " TEXT )";
 private final static String CREATE_TABLE = "CREATE TABLE " + TABLE_NAME + " (" + TABLE_ID + " INTEGER PRIMARY KEY," + TABLE_NUM + " INTERGER,"+ TABLE_D1 +
 " INTERGER,"+ TABLE_D2 + " INTERGER,"+ TABLE_D3 + " INTERGER,"+ TABLE_D4 + " INTERGER,"+ TABLE_D5 + " INTERGER,"+ TABLE_D6 + " INTERGER,"+ TABLE_D7 + " INTERGER,"+ TABLE_CODE + " TEXT ,"+SITE + " TEXT ,"+HSUM + " TEXT ,"+HALF_CODE + " TEXT )";

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);        
  //requestWindowFeature(Window.FEATURE_NO_TITLE);   
  //getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);   
  //setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);        
        setContentView(R.layout.main);                 //mTextView = (TextView)this.findViewById(R.id.TextVIEw01);
  bt1 = (Button)this.findVIEwById(R.id.Button01);
  bt2 = (Button)this.findVIEwById(R.id.Button02);
  bt3 = (Button)this.findVIEwById(R.id.Button03);
  bt4 = (Button)this.findVIEwById(R.id.Button04);
  bt5 = (Button)this.findVIEwById(R.id.Button05);
  bt6 = (Button)this.findVIEwById(R.id.Button06);
  ed1 = (EditText)this.findVIEwById(R.id.EditText01);
  m_ListView = (ListView)this.findViewById(R.id.ListView01);   //mTextVIEw.setText("測試:");   
  mSQLiteDatabase = this.openOrCreateDatabase(DATABASE_NAME, MODE_PRIVATE, null);
  try    
   mSQLiteDatabase.execSQL(CREATE_TABLE);    // 刪除
   //mSQLiteDatabase.execSQL("DROP TABLE " + TABLE_NAME);   catch (Exception e)    UpdataAdapter();   
  bt1.setOnClickListener(new Button.OnClickListener()      
  @Override
  public void onClick(VIEw arg0) {    
   UpdataAdapter();      });
  bt2.setOnClickListener(new Button.OnClickListener(){

   @Override
   public void onClick(VIEw v) {     //mSQLiteDatabase.close();
    refresh();
    UpdataAdapter();
    //SearchAdapter("05","08");       
  bt3.setOnClickListener(new Button.OnClickListener(){

   @Override
   public void onClick(VIEw v) {
    // TODO Auto-generated method stub
    mSQLiteDatabase.execSQL("DROP TABLE " + TABLE_NAME);
    mSQLiteDatabase.execSQL(CREATE_TABLE);       
  bt4.setOnClickListener(new Button.OnClickListener(){

   @Override
   public void onClick(VIEw v) {
    // TODO Auto-generated method stub          mSQLiteDatabase.close();
    main.this.finish();       
  bt5.setOnClickListener(new Button.OnClickListener()      
  @Override
  public void onClick(VIEw arg0) {
   String es = ed1.getText().toString();
   int e = es.length();
   if(e == 4) {
    SearchAdapter(es.substring(0, 2),es.substring(2, 4));    else if(e == 6){
    SearchAdapter(es.substring(0, 2),es.substring(2, 4),es.substring(4, 6));             else if(e == 8){
             SearchAdapter(es.substring(0, 2),es.substring(2, 4),es.substring(4, 6),es.substring(6, 8));             else if(e == 10){
             SearchAdapter(es.substring(0, 2),es.substring(2, 4),es.substring(4, 6),es.substring(6, 8),es.substring(8, 10));    }
   else{
    Toast.makeText(bt5.getContext(), "輸入數值不合理!", Toast.LENGTH_SHORT).show();    }    //UpdataAdapter();      });
  bt6.setOnClickListener(new Button.OnClickListener()      
  @Override
  public void onClick(VIEw arg0) {    ed1.setText("");   }        }  
 public void UpdataAdapter()   // 獲取數據庫的Cursor
  Cursor cur = mSQLiteDatabase.query(TABLE_NAME, new String[] { TABLE_ID, TABLE_NUM, TABLE_CODE ,HALF_CODE,SITE,HSUM}, null, null, null, null, null);
        //Cursor cur = mSQLiteDatabase.execSQL("Select TABLE_ID, TABLE_NUM, TABLE_CODE ,HALF_CODE from "+TABLE_NAME+" ORDER BY " +TABLE_ID+" DESC");
  miCount = cur.getCount();
  if (cur != null && cur.getCount() >= 0)    // ListAdapter是ListVIEw和後台數據的橋梁
   ListAdapter adapter = new SimpleCursorAdapter(this,
   // 定義List中每一行的顯示模板     R.layout.daletou,
    // 數據庫的Cursor對象
    cur,
    // 從數據庫的TABLE_NUM和TABLE_DATA兩列中取數據
    new String[] { TABLE_NUM, TABLE_CODE,SITE,HSUM},
    // 與NAME和NUMBER對應的VIEws
    new int[] { R.id.TextView01, R.id.TextView02 ,R.id.TextView03 ,R.id.TextVIEw04});

   
   m_ListVIEw.setAdapter(adapter);  }  public void SearchAdapter(String s1,String s2)   int temp,t1,t2;
  t1 = Integer.parseInt(s1);
  t2 = Integer.parseInt(s2);
  if(t1>t2){
   temp = t1;
   t1 = t2;
   t2 = temp;   
  // 獲取數據庫的Cursor
  Cursor cur = mSQLiteDatabase.query(TABLE_NAME, new String[] { TABLE_ID, TABLE_NUM, TABLE_CODE ,HALF_CODE,TABLE_D1,TABLE_D2,TABLE_D3,TABLE_D4,TABLE_D5,SITE,HSUM},
    " ("+TABLE_D1+ " = "+t1 +" and "+TABLE_D2+ " = "+t2+") "
    +" or "+
    " ("+TABLE_D1+ " = "+t1 +" and "+TABLE_D3+ " = "+t2+") "
    +" or "+
    " ("+TABLE_D1+ " = "+t1 +" and "+TABLE_D4+ " = "+t2+") "
    +" or "+
    " ("+TABLE_D1+ " = "+t1 +" and "+TABLE_D5+ " = "+t2+") "
    +" or "+
    " ("+TABLE_D2+ " = "+t1 +" and "+TABLE_D3+ " = "+t2+") "
    +" or "+
    " ("+TABLE_D2+ " = "+t1 +" and "+TABLE_D4+ " = "+t2+") "
    +" or "+
    " ("+TABLE_D2+ " = "+t1 +" and "+TABLE_D5+ " = "+t2+") "
    +" or "+
    " ("+TABLE_D3+ " = "+t1 +" and "+TABLE_D4+ " = "+t2+") "
    +" or "+
    " ("+TABLE_D3+ " = "+t1 +" and "+TABLE_D5+ " = "+t2+") "
    +" or "+
    " ("+TABLE_D4+ " = "+t1 +" and "+TABLE_D5+ " = "+t2+") "
    //+" or "+
    //"(d2 = "+s1+" and d3 = "+s2+")"+" or "+
    //"(d3 = "+s1+" and d4 = "+s2+")"+" or "+
    //"(d4 = "+s1+" and d5 = "+s2+")"
    , null, null, null, null);
        //Cursor cur = mSQLiteDatabase.execSQL("Select TABLE_ID, TABLE_NUM, TABLE_CODE ,HALF_CODE from "+TABLE_NAME+" ORDER BY " +TABLE_ID+" DESC");
  miCount = cur.getCount();
  if (cur != null && cur.getCount() >= 0)    // ListAdapter是ListVIEw和後台數據的橋梁
   ListAdapter adapter = new SimpleCursorAdapter(this,
   // 定義List中每一行的顯示模板     R.layout.daletou,
    // 數據庫的Cursor對象
    cur,
    // 從數據庫的TABLE_NUM和TABLE_DATA兩列中取數據
    new String[] { TABLE_NUM, TABLE_CODE ,SITE,HSUM},
    // 與NAME和NUMBER對應的VIEws
    new int[] { R.id.TextView01, R.id.TextView02, R.id.TextView03  ,R.id.TextVIEw04});

   
   m_ListVIEw.setAdapter(adapter);  }
 public void SearchAdapter(String s1,String s2,String s3)   int t1,t2,t3;
  t1 = Integer.parseInt(s1);
  t2 = Integer.parseInt(s2);
  t3 = Integer.parseInt(s3);
  int[] d = new int[]{t1,t2,t3};
  Java.util.Arrays.sort(d);
  t1 = d[0];
  t2 = d[1];
  t3 = d[2];   
  // 獲取數據庫的Cursor
  Cursor cur = mSQLiteDatabase.query(TABLE_NAME, new String[] { TABLE_ID, TABLE_NUM, TABLE_CODE ,HALF_CODE,TABLE_D1,TABLE_D2,TABLE_D3,TABLE_D4,TABLE_D5,SITE,HSUM},
    " ("+TABLE_D1+ " = "+t1 +" and "+TABLE_D2+ " = "+t2+" and "+TABLE_D3+ " = "+t3+") "
    +" or "+
    " ("+TABLE_D1+ " = "+t1 +" and "+TABLE_D2+ " = "+t2+" and "+TABLE_D4+ " = "+t3+") "
    +" or "+
    " ("+TABLE_D1+ " = "+t1 +" and "+TABLE_D2+ " = "+t2+" and "+TABLE_D5+ " = "+t3+") "
    +" or "+
    " ("+TABLE_D1+ " = "+t1 +" and "+TABLE_D3+ " = "+t2+" and "+TABLE_D4+ " = "+t3+") "
    +" or "+
    " ("+TABLE_D1+ " = "+t1 +" and "+TABLE_D3+ " = "+t2+" and "+TABLE_D5+ " = "+t3+") "
    +" or "+
    " ("+TABLE_D1+ " = "+t1 +" and "+TABLE_D4+ " = "+t2+" and "+TABLE_D5+ " = "+t3+") "
    +" or "+
    " ("+TABLE_D2+ " = "+t1 +" and "+TABLE_D3+ " = "+t2+" and "+TABLE_D4+ " = "+t3+") "
    +" or "+
    " ("+TABLE_D2+ " = "+t1 +" and "+TABLE_D3+ " = "+t2+" and "+TABLE_D5+ " = "+t3+") "
    +" or "+
    " ("+TABLE_D2+ " = "+t1 +" and "+TABLE_D4+ " = "+t2+" and "+TABLE_D5+ " = "+t3+") "
    +" or "+
    " ("+TABLE_D3+ " = "+t1 +" and "+TABLE_D4+ " = "+t2+" and "+TABLE_D5+ " = "+t3+") "
    , null, null, null, null);
        //Cursor cur = mSQLiteDatabase.execSQL("Select TABLE_ID, TABLE_NUM, TABLE_CODE ,HALF_CODE from "+TABLE_NAME+" ORDER BY " +TABLE_ID+" DESC");
  miCount = cur.getCount();
  if (cur != null && cur.getCount() >= 0)    // ListAdapter是ListVIEw和後台數據的橋梁
   ListAdapter adapter = new SimpleCursorAdapter(this,
   // 定義List中每一行的顯示模板     R.layout.daletou,
    // 數據庫的Cursor對象
    cur,
    // 從數據庫的TABLE_NUM和TABLE_DATA兩列中取數據
    new String[] { TABLE_NUM, TABLE_CODE ,SITE,HSUM},
    // 與NAME和NUMBER對應的VIEws
    new int[] { R.id.TextView01, R.id.TextView02, R.id.TextView03  ,R.id.TextVIEw04});

   
   m_ListVIEw.setAdapter(adapter);  }  public void SearchAdapter(String s1,String s2,String s3,String s4)   int t1,t2,t3,t4;
  t1 = Integer.parseInt(s1);
  t2 = Integer.parseInt(s2);
  t3 = Integer.parseInt(s3);
  t4 = Integer.parseInt(s4);
  int[] d = new int[]{t1,t2,t3,t4};
  Java.util.Arrays.sort(d);
  t1 = d[0];
  t2 = d[1];
  t3 = d[2];
  t4 = d[3];   
  // 獲取數據庫的Cursor
  Cursor cur = mSQLiteDatabase.query(TABLE_NAME, new String[] { TABLE_ID, TABLE_NUM, TABLE_CODE ,HALF_CODE,TABLE_D1,TABLE_D2,TABLE_D3,TABLE_D4,TABLE_D5,SITE,HSUM},
    " ("+TABLE_D1+ " = "+t1 +" and "+TABLE_D2+ " = "+t2+" and "+TABLE_D3+ " = "+t3+" and "+TABLE_D4+ " = "+t4+") "
    +" or "+
    " ("+TABLE_D1+ " = "+t1 +" and "+TABLE_D2+ " = "+t2+" and "+TABLE_D3+ " = "+t3+" and "+TABLE_D5+ " = "+t4+") "
    +" or "+
    " ("+TABLE_D1+ " = "+t1 +" and "+TABLE_D2+ " = "+t2+" and "+TABLE_D4+ " = "+t3+" and "+TABLE_D5+ " = "+t4+") "
    +" or "+
    " ("+TABLE_D1+ " = "+t1 +" and "+TABLE_D3+ " = "+t2+" and "+TABLE_D4+ " = "+t3+" and "+TABLE_D5+ " = "+t4+") "
    +" or "+
    " ("+TABLE_D2+ " = "+t1 +" and "+TABLE_D3+ " = "+t2+" and "+TABLE_D4+ " = "+t3+" and "+TABLE_D5+ " = "+t4+") "
    , null, null, null, null);
        //Cursor cur = mSQLiteDatabase.execSQL("Select TABLE_ID, TABLE_NUM, TABLE_CODE ,HALF_CODE from "+TABLE_NAME+" ORDER BY " +TABLE_ID+" DESC");
  miCount = cur.getCount();
  if (cur != null && cur.getCount() >= 0)    // ListAdapter是ListVIEw和後台數據的橋梁
   ListAdapter adapter = new SimpleCursorAdapter(this,
   // 定義List中每一行的顯示模板     R.layout.daletou,
    // 數據庫的Cursor對象
    cur,
    // 從數據庫的TABLE_NUM和TABLE_DATA兩列中取數據
    new String[] { TABLE_NUM, TABLE_CODE ,SITE,HSUM},
    // 與NAME和NUMBER對應的VIEws
    new int[] { R.id.TextView01, R.id.TextView02, R.id.TextView03  ,R.id.TextVIEw04});

   
   m_ListVIEw.setAdapter(adapter);  }
 public void SearchAdapter(String s1,String s2,String s3,String s4,String s5)   int t1,t2,t3,t4,t5;
  t1 = Integer.parseInt(s1);
  t2 = Integer.parseInt(s2);
  t3 = Integer.parseInt(s3);
  t4 = Integer.parseInt(s4);
  t5 = Integer.parseInt(s5);
  int[] d = new int[]{t1,t2,t3,t4,t5};
  Java.util.Arrays.sort(d);
  t1 = d[0];
  t2 = d[1];
  t3 = d[2];
  t4 = d[3];
  t5 = d[4];   
  // 獲取數據庫的Cursor
  Cursor cur = mSQLiteDatabase.query(TABLE_NAME, new String[] { TABLE_ID, TABLE_NUM, TABLE_CODE ,HALF_CODE,TABLE_D1,TABLE_D2,TABLE_D3,TABLE_D4,TABLE_D5,SITE,HSUM},
    " ("+TABLE_D1+ " = "+t1 +" and "+TABLE_D2+ " = "+t2+" and "+TABLE_D3+ " = "+t3+" and "+TABLE_D4+ " = "+t4+" and "+TABLE_D5+ " = "+t5+") "    , null, null, null, null);
        //Cursor cur = mSQLiteDatabase.execSQL("Select TABLE_ID, TABLE_NUM, TABLE_CODE ,HALF_CODE from "+TABLE_NAME+" ORDER BY " +TABLE_ID+" DESC");
  miCount = cur.getCount();
  if (cur != null && cur.getCount() >= 0)    // ListAdapter是ListVIEw和後台數據的橋梁
   ListAdapter adapter = new SimpleCursorAdapter(this,
   // 定義List中每一行的顯示模板     R.layout.daletou,
    // 數據庫的Cursor對象
    cur,
    // 從數據庫的TABLE_NUM和TABLE_DATA兩列中取數據
    new String[] { TABLE_NUM, TABLE_CODE ,SITE,HSUM},
    // 與NAME和NUMBER對應的VIEws
    new int[] { R.id.TextView01, R.id.TextView02, R.id.TextView03  ,R.id.TextVIEw04});

   
   m_ListVIEw.setAdapter(adapter);  }  
 public long insertData(String num, String cd,int d1,int d2,int d3,int d4,int d5,int d6,int d7)   StringBuffer bf = new StringBuffer(cd);
  int t1 = 0;
  ContentValues initialValues = new ContentValues();
  initialValues.put(TABLE_NUM, num);
  //initialValues.put(TABLE_CODE, data);
  initialValues.put(TABLE_D1, d1);
  //t1= d1*2;
  //bf.delete(t1, t1+4);
  //bf.insert(t1-2, d1);   initialValues.put(TABLE_D2, d2);
  //t1= d2*2;
  //bf.delete(t1, t1+4);
  //bf.insert(t1-2, d2);   initialValues.put(TABLE_D3, d3);
  //t1= d3*2;
  //bf.delete(t1, t1+4);
  //bf.insert(t1-2, d3);   initialValues.put(TABLE_D4, d4);
  //t1= d4*2;
  //bf.delete(t1, t1+4);
  //bf.insert(t1-2, d4);   initialValues.put(TABLE_D5, d5);
  //t1= d5*2;
  //bf.delete(t1, t1+4);
  //bf.insert(t1-2, d5);
  initialValues.put(TABLE_D6, d6);
  //bf.insert(71, d6);
  initialValues.put(TABLE_D7, d7);
  //bf.insert(72, d7);
  //initialValues.put(TABLE_CODE, " "+d1+" "+d2+" "+d3+" "+d4+" "+d5+" "+d6+" "+d7+" ");   //initialValues.put(TABLE_CODE,bf.toString());
  initialValues.put(TABLE_CODE,cd);   initialValues.put(HSUM,d1+d2+d3+d4+d5);
  //StringBuffer bf1 = new StringBuffer(code1);
  //t1= d6*2;
  //bf1.insert(t1, d6);   //t1= d7*2;
  //bf1.insert(t1, d7);
  int[] s11 = new int[]{d1%7,d2%7,d3%7,d4%7,d5%7};
  for(int i=0;i<s11.length;i++){
   if(s11[i]==0)
    s11[i]=7;   }
  Java.util.Arrays.sort(s11);
  initialValues.put(SITE , ""+s11[0]+s11[1]+s11[2]+s11[3]+s11[4]);
  initialValues.put(HALF_CODE," "+d6+" "+d7);

  return mSQLiteDatabase.insert(TABLE_NAME, TABLE_ID, initialValues);    
    public void refresh(){            
   String daletou = "http://chart.sports.cn/JSP/sy/gameMap/xml/188.XML";
   URL url = null;    
   try{
    url = new URL(daletou);
   }catch(MalformedURLException e){
    Log.e(DEBUG_TAG, "cccccc");   if(url != null){    
   try {
    HttpURLConnection urlConn = (HttpURLConnection)url.openConnection();
    DocumentBuilderFactory domfac = DocumentBuilderFactory.newInstance();
    DocumentBuilder dombuilder=domfac.newDocumentBuilder();
    InputStream is = urlConn.getInputStream();
             Document doc = dombuilder.parse(is);
             Element root=doc.getDocumentElement();
             NodeList nlist=root.getChildNodes();
             if(nlist != null){               mSQLiteDatabase.execSQL("DROP TABLE "+ TABLE_NAME);
              mSQLiteDatabase.execSQL(CREATE_TABLE);               String dateNum = "dateNum";
              String code = "code";
              String d1="0";
              String d2="0";
              String d3="0";
              String d4="0";
              String d5="0";
              String d6="0";
              String d7="0";               for (int i = 0; i < nlist.getLength(); i++) {                Node game = nlist.item(i);
               if(game.getNodeType()==Node.ELEMENT_NODE){
                dateNum = game.getAttributes().getNamedItem("dateNum").getNodeValue();
                      code = game.getAttributes().getNamedItem("code").getNodeValue();
                      d1=code.substring(0, 2);                     
                      d2=code.substring(3, 5);
                      d3=code.substring(6, 8);
                      d4=code.substring(9, 11);
                      d5=code.substring(12, 14);
                      d6=code.substring(15, 17);
                      d7=code.substring(18, 20);
                      //bt2.setText(d2);
                      insertData(dateNum,
                        code,
                        Integer.parseInt(d1),
                        Integer.parseInt(d2),
                        Integer.parseInt(d3),
                        Integer.parseInt(d4),
                        Integer.parseInt(d5),
                        Integer.parseInt(d6),
                        Integer.parseInt(d7));
                     Log.e(code, d1);               }
             }else{              }

   } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
   } catch (Exception e) {           
         }finally{
          //m_dialog.dismiss();
         }

        }    
}

////////////////////listvIEw用到的XML:

<?XML version="1.0" encoding="utf-8"?>
<RelativeLayout XMLns:android="http://schemas.android.com/apk/res/android"
    android:orIEntation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#FFFFFF" >

<TextView android:text="@+id/TextView01" android:textColor="#0000FF" android:background="#FFFFFF"  android:textSize="6pt"  android:id="@+id/TextVIEw01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="2pt"></TextVIEw>

<TextView android:text="@+id/TextView02" android:textColor="#009900" android:background="#FFFFFF"  android:textSize="6pt" android:id="@+id/TextView02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@id/TextVIEw01" android:layout_marginLeft="5pt"></TextVIEw>
<TextView android:text="@+id/TextView03" android:textColor="#FF3300" android:background="#FFFFFF"  android:textSize="6pt" android:id="@+id/TextView03" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@id/TextVIEw02" android:layout_marginLeft="5pt"></TextVIEw>
<TextView android:text="@+id/TextView04" android:textColor="#9900CC" android:background="#FFFFFF"  android:textSize="6pt" android:id="@+id/TextView04" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@id/TextVIEw03" android:layout_marginLeft="5pt"></TextVIEw>

</RelativeLayout>

  1. 上一頁:
  2. 下一頁:
熱門文章
閱讀排行版
Copyright © Android教程網 All Rights Reserved