構成の復元

DataWedge 11.0

RESTORE_CONFIG

DataWedge 6.4 で導入。

ユーザーか構成したすべての設定をリセットし、DataWedge を出荷時のデフォルト設定に戻します。このアクションは元に戻せません。詳細については、DataWedge の復元を参照してください。

関数プロトタイプ

Intent i = new Intent();
i.setAction("com.symbol.datawedge.api.ACTION");
i.putExtra("com.symbol.datawedge.api.RESTORE_CONFIG", "");

パラメータ

ACTION [String]: "com.symbol.datawedge.api.ACTION"

EXTRA_DATA [String]: "com.symbol.datawedge.api.RESTORE_CONFIG"

EXTRA VALUE: 空の文字列

コード例

//SENDING THE INTENT
Intent i = new Intent();
i.setAction("com.symbol.datawedge.api.ACTION");
i.putExtra("com.symbol.datawedge.api.RESTORE_CONFIG", "");
this.sendBroadcast (i);

結果コードの設定/取得

コマンドおよび構成インテント パラメータは、結果コードを送信するかどうかを決定します (デフォルトでは無効)。SEND_RESULT を使用する場合は、結果コードと元のインテントを照合するために、COMMAND_IDENTIFIER を使用します。こうしたパラメータの使用方法のサンプルを以下に示します。

注: 使用する API に合わせて、この汎用コードを変更します

// send the intent
    Intent i = new Intent();
    i.setAction(ACTION);
    i.putExtra("com.symbol.datawedge.api.CREATE_PROFILE", "Profile1");

// request and identify the result code
    i.putExtra("SEND_RESULT","true");
    i.putExtra("COMMAND_IDENTIFIER","123456789");
    this.sendBroadcast(i);

// register to receive the result
    public void onReceive(Context context, Intent intent){

        String command = intent.getStringExtra("COMMAND");
        String commandidentifier = intent.getStringExtra("COMMAND_IDENTIFIER");
        String result = intent.getStringExtra("RESULT");

        Bundle bundle = new Bundle();
        String resultInfo = "";
        if(intent.hasExtra("RESULT_INFO")){
            bundle = intent.getBundleExtra("RESULT_INFO");
            Set<String> keys = bundle.keySet();
            for (String key: keys) {
                resultInfo += key + ": "+bundle.getString(key) + "\n";
            }
        }

        String text = "Command: "+command+"\n" +
                      "Result: " +result+"\n" +
                      "Result Info: " +resultInfo + "\n" +
                      "CID:"+commandidentifier;

        Toast.makeText(context, text, Toast.LENGTH_LONG).show();

    };

関連項目:

Zebra Support Central | インテグレータ ガイド、製品マニュアル、ソフトウェア ダウンロードおよびサポート

LaunchPad | Zebra 開発者コミュニティ

インテント | Android 開発者

インテントおよびインテント フィルタ | Android 開発者

Android インテント | チュートリアル