GET_ACTIVE_PROFILE
DataWedge が現在使用しているプロファイル名を取得します。
関数プロトタイプ
Intent i = new Intent(); i.setAction("com.symbol.datawedge.api.ACTION"); i.putExtra("com.symbol.datawedge.api.GET_ACTIVE_PROFILE", "");
パラメータ
ACTION [String]: "com.symbol.datawedge.api.ACTION"
EXTRA_DATA [String]: "com.symbol.datawedge.api.GET_ACTIVE_PROFILE"
EXTRA VALUE: 空の文字列
戻り値
アクティブな DataWedge プロファイルの名前の文字列を返します
EXTRA NAME: "com.symbol.datawedge.api.RESULT_GET_ACTIVE_PROFILE"
EXTRA TYPE [String]: [ ]
コード例
//Sending the intent Intent i = new Intent(); i.setAction("com.symbol.datawedge.api.ACTION"); i.putExtra("com.symbol.datawedge.api.GET_ACTIVE_PROFILE", ""); this.sendBroadcast(i); //Receiving the result private BroadcastReceiver myBroadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { Bundle extras = getIntent().getExtras(); if (intent.hasExtra("com.symbol.datawedge.api.RESULT_GET_ACTIVE_PROFILE")) { String activeProfile = extras.getString("com.symbol.datawedge.api.RESULT_GET_ACTIVE_PROFILE"); } } } // Register/unregister broadcast receiver and filter results void registerReceivers() { IntentFilter filter = new IntentFilter(); filter.addAction("com.symbol.datawedge.api.RESULT_ACTION"); filter.addCategory("android.intent.category.DEFAULT"); registerReceiver(mybroadcastReceiver, filter); } void unRegisterReceivers(){ unregisterReceiver(mybroadcastReceiver); }
関連項目:
Zebra Support Central | インテグレータ ガイド、製品マニュアル、ソフトウェア ダウンロードおよびサポート
LaunchPad | Zebra 開発者コミュニティ
インテント | Android 開発者
インテントおよびインテント フィルタ | Android 開発者
Android インテント | チュートリアル