Code example for Intent

Methods: putExtrasetData

0
                String intentAction = mIntentField.getText().toString(); 
                String intentData = mDataField.getText().toString(); 
                String account = mAccountField.getText().toString(); 
                String resource = mResourceField.getText().toString(); 
 
                Intent intent = new Intent(intentAction); 
                if (!TextUtils.isEmpty(intentData)) { 
                    intent.setData(Uri.parse(intentData)); 
                } 
                intent.putExtra("account", account); 
                intent.putExtra("resource", resource); 
                if (v == mSendBroadcastButton) { 
                    sendBroadcast(intent); 
                } else { 
                    startActivity(intent); 
                } 
 
                setResult(RESULT_OK); 
                finish(); 
            } 
        }