0

変更されるAndroid用のアプリケーションがあります。問題は次のとおりです。

起動するアプリは画面構成とデータ管理(アプリ自体)が1つで、これを修正して複数画面(画面設定、アプリ、情報など)で同じアプリを持ち、メニューも含めたいオプション ..

onCreate 内には、いくつかのメソッドがあり、このクラスからもいくつかのメソッドがあり、これらを取得するために実行できるように、(それ以外の場合) 出て、各クラスの独立したディスプレイと対話する必要があります..

コードは次のようになります...

package com.Test1;

com.Test1.R.drawable をインポートします。

public class Test1Activity extends Activity {

public handler_thread handlerThread;
public TestInterface uartInterface;

EditText readText;                              
EditText writeText;                             
Spinner Option1Spinner;                         
Button writeButton, configButton;               


byte[] writeBuffer;

public Context global_context;
public boolean bConfiged = false;
public SharedPreferences sharePrefSettings;
Drawable originalDrawable;
public String act_string; 


@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    readText = (EditText) findViewById(R.id.ReadValues);
    writeText = (EditText) findViewById(R.id.WriteValues);

    global_context = this;

    configButton = (Button) findViewById(R.id.configButton);
    writeButton = (Button) findViewById(R.id.WriteButton);

    originalDrawable = configButton.getBackground();

    '
    '
    '



    configButton.setOnClickListener(new View.OnClickListener() {

        // @Override
        public void onClick(View v) {
            '
    '
    '
        }

    });

    /* handle write click */
    writeButton.setOnClickListener(new View.OnClickListener() {

        // @Override
        public void onClick(View v) {
            '
    '
    '

            }
        }
    });

    getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);

    handlerThread = new handler_thread(handler);
    handlerThread.start();

}





protected void cleanPreference(){
        '
    '
    '
}



public class SelectedListener implements OnItemSelectedListener {
    public void onItemSelected(AdapterView<?> parent, View view, int pos,
            '
    '
    '
}

public class SelectedListener implements OnItemSelectedListener {
    public void onItemSelected(AdapterView<?> parent, View view, int pos,
            '
    '
    '
}




//@Override
public void onHomePressed() {
    onBackPressed();
}   

public void onBackPressed() {
    super.onBackPressed();
}   




private class handler_thread extends Thread {
    Handler mHandler;

    /* constructor */
    handler_thread(Handler h) {
        mHandler = h;
    }

    public void run() {
        Message msg;

        while (true) {

            try {
                Thread.sleep(200);
            } catch (InterruptedException e) {
            }

            status = Interface.ReadData(4096, readBuffer,actualNumBytes);

            if (status == 0x00 && actualNumBytes[0] > 0) {
                msg = mHandler.obtainMessage();
                mHandler.sendMessage(msg);
            }

        }
    }
}

}

4

1 に答える 1

0

Bundle 引数を使用する必要があると思います。この答えはあなたを助けることができます

https://stackoverflow.com/a/3913720/2382964

于 2013-05-14T18:51:13.000 に答える